JavaScript >> Check falsy value
var val; //falsy values can be false, "", NaN, undefined, null var x = Boolean(val);