I have little confusion in this. I am using Auth0 and writing rules which uses node.js syntax. Now I read somewhere that the right way to check undefined value in node is typeof value === 'undefined'
but value === undefined
also work in node. So what is the main difference in both of them?
Asked
Active
Viewed 1,135 times
2

Ask
- 3,076
- 6
- 30
- 63
-
If `value` is *undeclared* the second way would throw a ReferenceError. But other than that, it's the same thing. – VLAZ Nov 14 '18 at 06:24
-
Possible duplicate of : https://stackoverflow.com/questions/4725603/variable-undefined-vs-typeof-variable-undefined Please see if this helps. – Mayank Parnami Nov 14 '18 at 06:24
-
@vlaz You mean the first way would throw too ..? – Teemu Nov 14 '18 at 06:26
-
@MayankParnami, aah sorry. My bad – Ask Nov 14 '18 at 06:38