I was looking for info on JavaScript destructuring and found the video "Destructuring Assignment" as part of a video series from Packt Publication. At the very beginning of the video, I saw the following code:
var [a, b] = [1,2,3];
a === 1;
b === 3;
The presenter then explains why variable b is 3 and not 2, which didn't seem correct to me, but I thought maybe I'm wrong.
So I did a Code Pen with the following code:
var [a, b] = [1,2,3]
console.log(a,b) //1 2
As I expected, the variable b is 2.
Is there something I'm missing and not understanding?
Below is a screenshot of the video in questions.