2 ms·
This is only a problem when you remove properties from an object. Ok, in this particular case, I buy your theory... but I'll ask again: is all the added cruft r
by rodneon 8y ago
This is only a problem when you remove properties from an object. Ok, in this particular case, I buy your theory... but I'll ask again: is all the added cruft really worth this small safety? I mean, when you say "when the types of objects (...) are known"... isn't this the kind of stuff that tests are supposed to catch? You check to see if the object being passed into a function has all the properties it needs to have. Right? And if you need that kind of safety, couldn't you just enforce the use of constructors for "important" objects, and use instanceof to check for proper usage? All while using the constructs provided by JavaScript itself?