← Back to release summary
Upsert
- Category
- JavaScript
- Type
- Chromium catches up
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
ECMAScript proposal for Map.prototype.getOrInsert, Map.prototype.getOrInsertComputed, WeakMap.prototype.getOrInsert, and WeakMap.prototype.getOrInsertComputed.
Standards & signals
- Specification: https://github.com/tc39/proposal-upsert
- Firefox: Shipped/Shipping — Firefox now supports the upsert proposal. This adds getOrInsert and getOrInsertComputed methods to Map and WeakMap. These methods either return the value associated with a key, or insert a default value, and then return that value, simplifying handling of cases where it's not known if a key is already present in the Map or WeakMap.
- Safari: Shipped/Shipping — Added support for Map.prototype.getOrInsert and WeakMap.prototype.getOrInsert. (138955824)
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/u/1/issues/434977728
View on chromestatus.com