ES6 - Use Destructuring Assignment to Assign Variables from Arrays

Tell us what’s happening:
I have tried the following code but the test isn’t passing, upon checking the code in the console, it says

Uncaught SyntaxError: Identifier ‘a’ has already been declared

I thought we can re-declare a as it is let. I am very confused.

Your code so far

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

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Challenge: ES6 - Use Destructuring Assignment to Assign Variables from Arrays

Link to the challenge:

this is declaring variables a and b, giving an error as those are already declared
you can use destructuring without declaring the variables, but using already declared variables

You can not redeclare let variables inside the same scope. You can reassign their values, not redeclare them.

let uniqueIdentifier = 'Dynamic value';
let uniqueIdentifier; // SyntaxError: Identifier 'uniqueIdentifier' has already been declared

{
  let uniqueIdentifier = 'New Scope'
  console.log(uniqueIdentifier); // New Scope
}


Just as an aside. The Chrome console allows for let variables to be redeclared. It is meant as a convenience. But if you run both lines of code at the same time it will still throw an error.