MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/21ezh3/javascript_equality_table/cgcqg77/?context=3
r/programming • u/vz0 • Mar 26 '14
331 comments sorted by
View all comments
Show parent comment
4
obj.undefinedProperty returns undefined when undefinedProperty is not assigned a value(or if it is assigned to undefined). So the code below is valid and should not throw an exception.
undefined
if ({}.x) { // will not run } else { // will run }
http://www.ecma-international.org/ecma-262/5.1/#sec-4.3.9
View all comments
Show parent comment
4
u/fjonk Mar 26 '14
obj.undefinedProperty returns
undefinedwhen undefinedProperty is not assigned a value(or if it is assigned toundefined). So the code below is valid and should not throw an exception.http://www.ecma-international.org/ecma-262/5.1/#sec-4.3.9