loading...

re: What you need to know about Javascript's Implicit Coercion VIEW POST

FULL DISCUSSION
 

Only case where I like to use type coercion is with null.

There are only two values that == null : null and undefined. Same thing for undefined. So it's very useful for when you want to check if your variable holds an actual value and want to avoid an ugly (variable === null || variable === undefined), just do variable == null.

 
Code of Conduct Report abuse