News for hackers. Stuff that matters.
Re:A re-introduction to JavaScript by CrystalGamma on Saturday May 09, 2015 @03:50PM (#9517470)
Its main purpose is deleting a property from an object, which is a pretty slow operation on modern JS engines. Unless some code tests for the existence of a property, setting it to null is a better idea.
Re:A re-introduction to JavaScript by tracker1 on Saturday May 09, 2015 @10:22PM (#9518517)
I'd suggest undefined over null if you want to effectively remove a property, since JSON.stringify won't serialize those properties... in an array, it will become null.

Though, I don't use delete much, I honestly don't worry about it much. In most contexts it's a bit of a premature optimization unless you are in a very low-level tool that will be used for example gaming, video or photo manipulation, there are probably better optimizations to make.