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

Limited availability

Specifications

Browser support

  • Chrome
  • Chrome Android
  • Edge
  • Firefox
  • Firefox for Android
  • Safari
  • Safari on iOS