WeakSet

Use WeakSet, দুর্বল_সমষ্টি, or DurbolSomoshti to keep a set of objects only held weakly (eligible for GC). It supports just add, has, and delete. It is not iterable and has no size.


Methods

  • add(obj)  ·  has(obj)  ·  delete(obj)

Examples

const ws = new দুর্বল_সমষ্টি();
const obj = {};
ws.যোগ(obj);
কনসোল.লগ(ws.আছে_কি(obj)); // true
ws.মুছুন(obj);
কনসোল.লগ(ws.আছে_কি(obj)); // false

Notes

  • Only objects can be stored; primitives (numbers, strings, etc.) are not allowed.
  • Not enumerable: no size, keys(), values(), entries(), or forEach().