Using a WeakMap for private data ensures that the data is garbage collected when the object key is no longer ________.

  • Referenced
  • Immutable
  • Mutable
  • Valid
When using a WeakMap for private data, the data is tied to the object key, and it will be garbage collected when the object is no longer referenced elsewhere in the code. This helps in managing memory efficiently for private data in JavaScript.
Add your answer
Loading...

Leave a comment

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