Object destructuring in JavaScript

Viewed 131
>{a} = {a: true} // Statement
<{a: true}

The above statement is assigning the value true to a

Why is the above statement not giving error in the chrome console? While the below statement gives an error.

>{a} = {a: true}; // Statement
<Uncaught SyntaxError: Unexpected token '='

How does the semicolon at the end matter?

0 Answers
Related