On this page
  1. Map.has
  2. Signature & Overview
  3. Notes & Pitfalls
  4. Example

Map.has

Prev: get | Up: Map | Next: groupBy
Rel: Map, Collections Guide
Ref: MDN Web Docs — Map.has
Tags: #public #web #javascript #builtins #map #tier/core


Signature & Overview

map.has(key)  /* + map.delete(key), map.clear() */

Returns true if key exists in map (distinguishing missing keys from keys mapped to undefined).

Notes & Pitfalls

Example

const m = new Map([[NaN, "ok"]]);
console.assert(m.has(NaN) === true);

Linked from

Related notes