You want the typeof operator. Specifically:
typeof
if (typeof variable === 'undefined') { // variable is undefined }
Read full article from dom - How can I check whether a variable is defined in JavaScript? - Stack Overflow
No comments:
Post a Comment