Noticed an interesting behavior of Javascript while playing with Array Destructuring eg:
let a = [1, 2, 3];
let b = [one, two, three, four = 4] = a
console.log(one, two, three, four)
console.log(b)
When I say a.length output is 3
If I say b.length output is 3.
However, if I say four output is 4.
If four is an element of b then why b.length is shown as 3 why not as 4?
a = b = cis equivalent tob=c, a=cnotb=c, a=b. This means in your case[one, two, three, four=4] = a; let b = a;