JS Built-ins
WeakSetaddbeginner

WeakSet.prototype.add() β€” has returns true

πŸ“– Usage Example
const ws = new WeakSet()
const obj = {}
ws.add(obj)
ws.has(obj)  // β†’ true

add() inserts an object into the WeakSet.

WeakSet add()

After ws.add(obj), ws.has(obj) is true.

Challenge: Verify add makes has return true.

πŸ’‘ Hints (1)
  • β€’ add() inserts the object; has() confirms it.