Use Destructuring Assignment to Assign Variables from Arrays Code Doesn't Work

I don’t get why this won’t work, i just followed the array swapping here:

Your code so far

let a = 8, b = 6;
(() => {
  "use strict";
  // change code below this line
   [a,b] = [b,a];
  // change code above this line
console.log(a); // should be 6
console.log(b); // should be 8

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0.

Link to the challenge:

Works for me! Try again

1 Like