Does modern JavaScript have a terse way to get an object's property and raise an exception if that property doesn't exist?
-
-
Replying to @garybernhardt
so many edge cases. do you care if the key is explicitly set to `undefined`? (ie does `obj["foo"] = undefined` qualify as set or unset?)
1 reply 0 retweets 3 likes -
Replying to @jasonkarns @garybernhardt
Do you care about the property being set directly on the object vs potentially being inherited from the object's prototype chain?
2 replies 0 retweets 1 like -
Replying to @jasonkarns @garybernhardt
Do you want to include or exclude non-enumerable properties?
1 reply 0 retweets 0 likes -
Replying to @jasonkarns
I'm not sure what that means. What's a non-enumerable property?
3 replies 0 retweets 0 likes -
Replying to @garybernhardt @jasonkarns
Short version: Properties that aren't included in when doing `for (key in obj)`, mostly symbols. An easy example is the length property of an array
1 reply 0 retweets 0 likes -
Replying to @sgrif @jasonkarns
Oh, I guess that's what the words mean, but as usual I didn't even think of the possibility that a language would actually be designed this way...
1 reply 0 retweets 1 like
It was less of an intentional original design, and more something that became concrete as the language matured (I believe ES5 was when it became a concrete thing you can control and query)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.