In a WeakMap, keys must be of type _________, and they are not enumerable.

  • Object
  • String
  • Symbol
  • Number
In a WeakMap, keys must be of type Symbol, and they are not enumerable. Symbols are unique and help in creating private properties or methods. Using other types as keys will result in unexpected behavior.
Add your answer
Loading...

Leave a comment

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