4 ms·
That's only a serious issue if the binding may not exist at all, which is an other way to say that it's only useful for global variables. A function parameter d
by masklinn 11y ago
That's only a serious issue if the binding may not exist at all, which is an other way to say that it's only useful for global variables. A function parameter defines a binding by definition.
- deckar01 11y agoGood to know. I peeked into underscore's source to see how this type of check is handled. Aparently the issue is more complicated than I thought, because the following comparison is used: obj[key] === void 0 Are they really defending themselves against the function being rebound with undefined shadowed? http://adripofjavascript.com/blog/drips/javascripts-void-operator.html http://adripofjavascript.com/blog/drips/javascripts-void-ope...
- masklinn 11y agoYeah. It might be an issue when you're a widely used library, you might routinely encounter completely insane stuff. In a codebase you own though, I wouldn't worry about it, you can just set whoever decides rebinding undefined is funny on fire.