I want to guard my functions against null-ish values and only continue if there is "defined" value.
After looking around the solutions suggested to double equal to undefined: if (something == undefined)
. The problem with this solution is that you can declare an undefined variable.
So my current solution is to check for null if(something == null)
which implicetly checks for undefined. And if I want to catch addionalty falsy values I check if(something)
.
See tests here: http://jsfiddle.net/AV47T/2/
Now am I missing something here?
Matthias