I wanted to check whether the variable is defined or not. For example, the following throws a not-defined error
alert( x );
How can I cat
Just do something like below:
function isNotDefined(value) { return typeof value === "undefined"; }
and call it like:
isNotDefined(undefined); //return true isNotDefined('Alireza'); //return false