You can use typeof
, like this:
if (typeof something != "undefined") {
// ...
}
if (typeof myVar !== "undefined") {
function_call();
}
You can use typeof
, like this:
if (typeof something != "undefined") {
// ...
}
if (typeof myVar !== "undefined") {
function_call();
}