Ruben Bridgewater | Node.js

@bridgear.bsky.social

Open source enthusiast, Staff Engineer @datadog, Node.js Technical Steering Committee member

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 👍

// Currently
let prefs = new getUserPrefs();
if (!prefs.has("useDarkmode")) {
  prefs.set("useDarkmode", true); // default to true
}

// Using getOrInsert
let prefs = new getUserPrefs();
prefs.getOrInsert("useDarkmode", true); // default to true

ECMAScript excitement 😉 Next week's TC39 meeting has a packed agenda: 🔼 Amount 🔼 Array.prototype.pushAll 🔶 AsyncContext 🔶 Await Dictionary 🔼 Import Bytes 🔶 Intl Era Month Code 🔼 Iterator Chunking 🔶 new Global() 🔼 Non-extensible applies to private 🔼 Promise Adoption 🔼 Promise Predicate 🔶 Temporal

I'm helping put together a JS track on a large multitrack conference in Warsaw, April 4/5 Any of my friends here interested in speaking online or inperson?