Closed GrosSacASac closed 6 years ago
not sure if I understand you, the point here is
foo.bar = undefined // Efficient way (good)
instead of
delete foo.bar // Inefficient way (bad)
you keep bar
reference in the object, but this is less aggresive than delete the key for the garbage collector.
https://mythbusters.js.org/#/v8-tips/freeing-memory
using
can lead to memory leaks because foo keeps the string key "bar" stored potentially forever. Can happen when objects are used as maps.