MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/btxz72/what_are_some_javascript_things_beginners_dont/epb70ai/?context=3
r/javascript • u/[deleted] • May 28 '19
383 comments sorted by
View all comments
Show parent comments
16
let me end all your struggles:
the only time you use == instead of === in JS is when you do yourVar == null because this checks for null and undefined.
yourVar == null
2 u/[deleted] May 28 '19 Your data structures shouldn't usually be capable of being T | null | undefined, so I'd argue there's really no place for double equals in a modern codebase. 0 u/[deleted] May 29 '19 [deleted] 1 u/[deleted] May 29 '19 In which situation would you use that type in React?
2
Your data structures shouldn't usually be capable of being T | null | undefined, so I'd argue there's really no place for double equals in a modern codebase.
T | null | undefined
0 u/[deleted] May 29 '19 [deleted] 1 u/[deleted] May 29 '19 In which situation would you use that type in React?
0
[deleted]
1 u/[deleted] May 29 '19 In which situation would you use that type in React?
1
In which situation would you use that type in React?
16
u/[deleted] May 28 '19
let me end all your struggles:
the only time you use == instead of === in JS is when you do
yourVar == nullbecause this checks for null and undefined.