JS Built-ins
WeakSethasintermediate

WeakSet.prototype.has() β€” different references

πŸ“– Usage Example
const ws = new WeakSet()
const a = {x:1}, b = {x:1}
ws.add(a)
ws.has(b)  // β†’ false

Different object references are distinct entries even if structurally equal.

WeakSet Reference Identity

Two variables pointing to the same object share the same key.

Challenge: Verify alias references behave correctly.

πŸ’‘ Hints (1)
  • β€’ Two variables pointing to the same object share the same identity.