Posted By

PapillonUK on 04/29/10



Versions (?)

Check for undefined var

 / Published in: JavaScript

You can use if(!myVar) which will return True if a variable is undefined OR zero, but this method specifically checks for undefined.

  1. if(typeof(myVar) == "undefined")

Report this snippet  

You need to login to post a comment.