Wednesday, April 23, 2014

dom - How can I check whether a variable is defined in JavaScript? - Stack Overflow

You want the typeof operator. Specifically:

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