title: Optional arguments in nodejs functions
body: <p>What is the best way to create a function that takes optional arguments in nodejs?</p>
  
  <p>for example I know this method:-</p>
  
  <pre><code>    function optionalArguments(a,b){
          var a = a || "nothing";
          var b = b || "nothing";
      } 
  </code></pre>
  
  <p>but in this case if I do this :</p>
  
  <p>optionalArguments(false,false) </p>
  
  <p>both a and b return "nothing" although I have passed an argument.</p>
  
  <p>and also I get <strong>unexpected token error</strong> when I call the function like this :</p>
  
  <p>optionalArguments(,"xxx");</p>
  
  <p>Is there a better or a standard method to tackle optional arguments in nodejs?</p>
  
  <p>Any help is appreciated.
  Thanks in advance.</p>