Skip to content

Instantly share code, notes, and snippets.

@th3james
Created September 13, 2011 18:39
Show Gist options
  • Save th3james/1214638 to your computer and use it in GitHub Desktop.
Save th3james/1214638 to your computer and use it in GitHub Desktop.
typeof(some_var) // returns 'undefined'
//Therefore, the correct way in javascript to check if a variable has a value is:
typeof some_var === 'undefined'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment