All About Technology

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

Posted by Jeffery at 6:44 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ►  2016 (2)
    • ►  December (1)
    • ►  June (1)
  • ►  2015 (2)
    • ►  August (1)
    • ►  January (1)
  • ▼  2014 (2)
    • ►  December (1)
    • ▼  April (1)
      • dom - How can I check whether a variable is define...
Watermark theme. Powered by Blogger.