Web platform features explorer

Map getOrInsert()

The getOrInsert() and getOrInsertComputed() methods of Map objects get a value, setting and getting a default value if needed.

Status

Baseline Newly Available (since 2026-02-14)

This feature is expected to reach Baseline Widely Available status on: 2028-08-14

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