Which of the following is true about the WeakMap data structure?

JavaScript Developer Medium

JavaScript Developer — Medium

Which of the following is true about the WeakMap data structure?

Key points

  • WeakMap only allows object keys for automatic garbage collection
  • Entries are removed when key objects have no references
  • Ideal for scenarios where memory management is important

Ready to go further?

Related questions