TIL not using the delete keyword for performance issues
POSTED ON:
TAGS: javascript objects performance
The delete keyword is used to remove a property from an object.
Apparently, there is performance issues with delete
with V8 Javascript Engine. Issue1 and issue2
It's faster to just declare it as undefined.
const object = {name:"Jane Doe", age:43};
object.age = undefined;
Via https://www.joyk.com/dig/detail/1594756891396192
Related TILs
Tagged: javascript