The only other ways are cosmetic and are in fact loops.
For example :
array.forEach(function(v){ delete v.bad });
Notes:
- if you want to be compatible with IE8, you'd need a shim for forEach. As you mention prototype, prototype.js also has a shim.
delete
is one of the worst "optimization killers". Using it often breaks the performances of your applications. You can't avoid it if you want to really remove a property but you often can either set the property toundefined
or just build new objects without the property.