let a
function f() {
[a] = [1] // <<-----
return a
}
console.log(f())
How does [a] = ....
is called? it's not a normal assignment because a
is defined elsewhere.
Bonus:
Why prettier thinks that there should be semicolon before the [
?
let a
function f() {
[a] = [1] // <<-----
return a
}
console.log(f())
How does [a] = ....
is called? it's not a normal assignment because a
is defined elsewhere.
Why prettier thinks that there should be semicolon before the [
?