As of Firefox 144, I intend to enable the upsert proposal by default on all platforms. It is currently available in Nightly builds, but disabled by default and controlled by the `javascript.options.experimental.upsert` preference. The somewhat poorly named upsert proposal adds new getOrInsert and getOrInsertComputed methods to Map and WeakMap, that will either get or insert a default value depending upon whether the key is present. Our implementation was contributed by students at the University of Bergen, thank you!
The proposal reached Stage 3 of the TC39 process in July 2025, Safari shipped their implementation in 18.4 ( https://developer.apple.com/documentation/safari-release-notes/safari-18_4-release-notes), work does not appear to have started in Chromium ( https://issues.chromium.org/issues/434977728). Bug to turn on by default: https://bugzilla.mozilla.org/show_bug.cgi?id=1979917 Standard: https://github.com/tc39/proposal-upsert. -- You received this message because you are subscribed to the Google Groups "[email protected]" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/CAC_Rxa5hV_z%2B7Z5QLCi5d--ieL6XNAWkr9vPCkrW-tzt8bfjTA%40mail.gmail.com.
