JS Built-ins
WeakSethasbeginner

WeakSet.prototype.has() β€” added object

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

has() returns true if the object is in the WeakSet.

WeakSet has()

ws.has(obj) returns true for an added object.

Challenge: Verify has() returns true.

πŸ’‘ Hints (1)
  • β€’ has() returns a boolean indicating presence.