What types of values can be added to a WeakSet?

  • Only objects can be added.
  • Any data type, including primitives, can be added.
  • Only functions can be added.
  • Only arrays can be added.
WeakSets exclusively allow objects, emphasizing their use for storing unique object references and aiding in scenarios like memory management.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *