Map getOrInsert()
Newly Available (since 2026-02-14)
Expected to be Widely Available on 2028-08-14
The getOrInsert() and getOrInsertComputed() methods of Map objects get a value, setting and getting a default value if needed.
Browser support
- Chrome 145 Released on 2026-02-10
- Chrome Android 145 Released on 2026-02-10
- Edge 145 Released on 2026-02-14
- Firefox 144 Released on 2025-10-14
- Firefox for Android 144 Released on 2025-10-14
- Safari 26.2 Released on 2025-12-12
- Safari on iOS 26.2 Released on 2025-12-12
MDN documentation
Specifications
- ECMAScript® 2027 Language Specification (#sec-map.prototype.getorinsert), from TC39 (Ecma International).
View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist