loading...

re: 5 Uses for the Spread Operator VIEW POST

FULL DISCUSSION
 

Also, here's a nice quick way to go from Map to array of entries.

let map = new Map([['a', 1], ['b', 2], [{foo: 'bar'}, 3]]);
let entries = [...map]; // [['a', 1], ['b', 2], [{foo: 'bar'}, 3]]

// maybe useful to quickly stringify a map?
JSON.stringify([...map])
Code of Conduct Report abuse