Are Map with no references and their values with no references GC'd?
# Jordan Harband (8 years ago)
If the Map is collected, all of its keys and values are no longer referenced by it, so if there were no other references to them, they'd be collected at some point.
I have a
WeakMapwhose values areMapinstances. The values of all theMaps inside theWeakMapareobjects. If references to keys of theWeakMapare lost and therefore those items removed from theWeakMap, will theMaps' values be GC'd if there are no references to the Maps or to the Map values.I'm intuitively assuming "yes", but just want to confirm that I don't have to explicitly removed everything from the
Maps manually first./#!/JoePea