JS Built-ins
WeakMaphasbeginner

WeakMap.prototype.has() β€” null value

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

Different object references are distinct keys even with the same structure.

WeakMap has() with null Value

Even if the value is null, has(key) returns true.

Challenge: Verify has() with null value.

πŸ’‘ Hints (1)
  • β€’ has() tests key existence, regardless of the stored value.