Map getOrInsert()
The getOrInsert() and getOrInsertComputed() methods of Map objects get a value, setting and getting a default value if needed.
Status
Limited availability
MDN documentation
Specifications
- ECMAScript® 2026 Language Specification (#sec-map.prototype.getorinsert), from TC39 (Ecma International).
Browser support
- Chrome ❌ See issues.chromium.org/u/1/issues/434977728
- Chrome Android ❌
- Edge ❌
- 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
Developer votes
Do you need this feature?
Let us know by leaving a 👍 reaction on the feedback issue. Don't forget to also leave a comment explaining your specific use case.
View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist