JS Built-ins
WeakSetaddbeginner

WeakSet.prototype.add() β€” multiple objects

πŸ“– Usage Example
const ws = new WeakSet()
const a = {}, b = {}
ws.add(a).add(b)

Chain add() calls to insert multiple objects.

WeakSet Multiple Objects

You can add many distinct objects to a WeakSet.

Challenge: Verify multiple objects can be added.

πŸ’‘ Hints (1)
  • β€’ Each object reference is stored independently.