I’ve notice some calls to “delete” sprinkled throughout the code and I am wondering why we would prefer delete versus simply setting to undefined? This jsperf test shows undefined is faster by far:
Also, delete (by design) does not always succeed, it returns true or false because on whether the property was deleted or not. In the case of assigning undefined, the value will always end up undefined. For prototype based objects, I’m pretty sure delete kills performance as well.
This article seems to go pretty in-depth, but I admit I haven’t read the entire thing yet: http://perfectionkills.com/understanding-delete/
Is there something I’m missing here?