1if(typeof comment === 'undefined') {
2
3 alert('Variable "comment" is undefined.');
4
5} else if(comment === null){
6
7 alert('Variable "comment" is null.');
8
9}
1if ( typeof query !== 'undefined' && query )
2{
3 //do stuff if query is defined and not null
4}
5else
6{
7
8}
9