How can I check whether a variable is defined in Node Js

JavaScript
if (query){
   doStuff();
}
Source

Also in JavaScript: