Use Destructuring Assignment to Assign Variables from Arrays(bug)


#1

Tell us what’s happening:
这个题目好像有Bug,我用相同得代码在vscode测试了一下发现a和b的值已经发生改变了

Your code so far


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

Your browser information:

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

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