One primary difference between WeakMap and Map is that WeakMap keys are ________ to garbage collection.

  • Referenced
  • Immutable
  • Strongly bound
  • Weakly bound
In a WeakMap, the keys are weakly held, meaning that they don't prevent the referenced objects from being garbage collected. This is particularly useful when using objects as keys, as it allows them to be garbage collected when they are no longer needed.
Add your answer
Loading...

Leave a comment

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