Check if variable is 'undefined' or 'null'
to check if javascript variable is undefined or nul use :
OR :
- <code>
- if(typeof variable_here === 'undefined'){
- // your code here.
- };
- </code>
- <code>
- if(! variable_here){
- // your code here.
- };
- </code>