JS Built-ins
WeakMaphasbeginner

WeakMap.prototype.has() β€” existing key

πŸ“– Usage Example
const wm = new WeakMap()
const k = {}
wm.set(k, 1)
wm.has(k)  // β†’ true

has() returns true if the given object key exists in the WeakMap.

WeakMap has()

wm.has(key) returns true when the key exists.

Challenge: Verify has() returns true for an existing key.

πŸ’‘ Hints (1)
  • β€’ has() checks key presence, not value truthiness.