nodejs check if variable is undefined

JavaScript
if(typeof comment === 'undefined') {

  alert('Variable "comment" is undefined.');

} else if(comment === null){

  alert('Variable "comment" is null.');

}if ( typeof query !== 'undefined' && query )
{
  //do stuff if query is defined and not null
}
else
{

}
javascript check number against undefined
Source

Also in JavaScript: