ES6 - Use Destructuring Assignment to Assign Variables from Arrays

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

let [a,b] = [8,6];
// Only change code below this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

ES6 - Use Destructuring Assignment to Assign Variables from Arrays

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

If that is all your code you have deleted the initial code and should reset the challenge. Do not add or change the code above the code comment.


  1. You can’t redeclare the variables.

  2. You should only use the two variables to swap the values, not reassign the variables with new literal values.

MDN: Swapping variables

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.