JS Built-ins
WeakMapgetbeginner

WeakMap.prototype.get() β€” missing key returns undefined

πŸ“– Usage Example
const wm = new WeakMap()
const k = {}
wm.get(k)  // β†’ undefined (not set)

get() returns undefined when the key has no associated value.

WeakMap get() Missing Key

wm.get(key) returns undefined when the key has no entry.

Challenge: Verify undefined for missing key.

πŸ’‘ Hints (1)
  • β€’ WeakMap.get() returns undefined when the key is absent.