determine if a variable is defined


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /** helper to determine if a variable is defined
  2.  */
  3. function isDefined(foo) {
  4. return 'undefined' !== typeof(foo) && null != foo;
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.