Use Destructuring Assignment to Assign Variables from Arrays


#1

Tell us what’s happening:

错误在哪

Your code so far


let a = 8, b = 6;
(() => {
  "use strict";
  // 在这行以下修改代码
  const [b,a] = [a,b];
  // 在这行以上修改代码
})();
console.log(a); // 应该等于 6
console.log(b); // 应该等于 8

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0.

Link to the challenge:
https://learn.freecodecamp.one/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays


#2

这个问题已解决:grinning: