Reposted by Ruben Bridgewater | Node.js
ECMAScript excitement 😉
Congrats to Dan Minor @mozilla.org on advancing the Upsert proposal to Stage 4 at TC39 today 🎉
let map = new Map();
map.getOrInsert(key, defaultVal);
It lets you set a default value on a map key without overwriting an existing value 👍