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();
}
Leave a Reply
You must be logged in to post a comment.