Posted By

jasonseney on 04/30/09


Tagged

javascript null undefined


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

jfherring
DesTincT
jonkemp


Javascript check for undefined or null object/variable


 / Published in: JavaScript
 

Based on some comments in StackOverflow Question

  1. if(typeof(foo) !== 'undefined' && foo != null) {
  2. //you can use foo!
  3. }

Report this snippet  

You need to login to post a comment.