I've been experimenting with this technique several times, but I still can't quite grasp why it works and haven't been able to find an answer. Can someone please explain?
let myArray = [0, 1]
let [myVar] = myArray
console.log(myVar) // outputs 0
How does [myVar] equate to the same as putting [0] after myArray?
Edit: I have already asked and received an answer here: Multiple assignment in javascript? What does [a,b,c] = [1, 2, 3]; mean?
Thank you to everyone who has contributed