Destructuring Assignment

There is now also a compact way of assigning values in an iterable to multiple variables in what appears to be an array.


RESETRUNFULL
<!DOCTYPE html><html><body><script>

var [a,b,c] = [1,2,3,4,5,6];console.log(a);  // 1console.log(b);  // 2console.log(c);  // 3var [ a = 1,, b = 3, c ] = [ 7, 42 ];console.log(a); // 7console.log(b); // 3console.log(c); // undefinedvar [d,e,f] = "def";  // any iterable will doconsole.log(d); // dconsole.log(e); // econsole.log(f); // f

</script></body><html>