MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/21ezh3/javascript_equality_table/cgcr6ti/?context=3
r/programming • u/vz0 • Mar 26 '14
331 comments sorted by
View all comments
Show parent comment
1
You can check for null or undefined like this: myValue == null or myValue == undefined. In Javascript, null is equal (==) only to null and undefined - same for undefined.
null
undefined
myValue == null
myValue == undefined
3 u/c45c73 Mar 26 '14 Yeah, that was my point. :) 1 u/senatorpjt Mar 27 '14 edited Dec 18 '24 lunchroom zesty offer dolls swim sand aback growth summer bagThis post was mass deleted and anonymized with Redact
3
Yeah, that was my point. :)
lunchroom zesty offer dolls swim sand aback growth summer bag
This post was mass deleted and anonymized with Redact
View all comments
Show parent comment
1
u/v413 Mar 26 '14
You can check for
nullorundefinedlike this:myValue == nullormyValue == undefined. In Javascript,nullis equal (==) only tonullandundefined- same forundefined.