i was taking lessons on ES6 key features but this snippet is troubling my common sense, how does javascript resolve ",b" to be the 2nd item in the return array of the foo function does b in the case implicitly mean 2nd item and z would mean 26th item ?? See code snippet below ...
function foo() {
return [1,2,3];
}
function bar() {
return {
x: 4,
y: 5,
z: 6
};
}
var [,b] = foo();
var { x, z } = bar();
console.log( b, x, z );
// 2 4 6