3 ms·
It's simply interesting that this: for (key in hash) hash[key] = null; May or may not call a bunch of functions. It could turn out to be a debugging n
by tolmasky 15y ago
It's simply interesting that this:
for (key in hash)
hash[key] = null;
May or may not call a bunch of functions. It could turn out to be a debugging nightmare.
- skrebbel 15y agoThere are many popular languages for which this is the case (C#, Ruby, PHP even), and I haven't heard anyone panic yet. The deal is that if you implement a property getter, you promise no side effects and fast execution (for some value of "fast"). If you don't do this, your code is broken.
- ootachi 15y agoIt always did in JavaScript from day one, given host objects.