javascript check if not undefined

59

nodejs check if variable is undefined -

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

}

Comments

Submit
0 Comments