A few minutes ago, i met with this:
var array = [1, 2, 4, 6];
var [two, four, eight, twelve] = array.map(num => num * 2);
console.log(four) // 4
Can someone explain how this works?
A few minutes ago, i met with this:
var array = [1, 2, 4, 6];
var [two, four, eight, twelve] = array.map(num => num * 2);
console.log(four) // 4
Can someone explain how this works?