title: Use Destructuring Assignment to Assign Variables from Arrays
challengeType: 1
---
## Description
<sectionid='description'>
ES6 makes destructuring arrays as easy as destructuring objects.
One key difference between the spread operator and array destructuring is that the spread operator unpacks all contents of an array into a comma-separated list. Consequently, you cannot pick or choose which elements you want to assign to variables.
Use destructuring assignment to swap the values of <code>a</code> and <code>b</code> so that <code>a</code> receives the value stored in <code>b</code>, and <code>b</code> receives the value stored in <code>a</code>.
</section>
## Tests
<sectionid='tests'>
```yml
- text: 'Value of <code>a</code> should be 6, after swapping.'