title: How to handle null URL parameters with Express.js
body: <p>I'm working on an assignment for my web services class and can't figure out how to handle a null URL parameter. Here is my code:</p>
  
  <pre class="lang-js prettyprint-override"><code>    app.get('/nachos/:x/:cheese/:tomatoes/:salsa/:hotsauce', (req, res) =&gt; {
          var x = parseInt(req.params['x'])
          var cheese = (req.params['cheese'])
          var tomatoes = (req.params['tomatoes'])
          var salsa = (req.params['salsa'])
          var hotsauce = (req.params['hotsauce'])
  
          res.send('You ordered ' + x + ' nacho(s) with ' + cheese + ', ' + tomatoes + ', ' + salsa + ', ' 
          + hotsauce + '.')})
  </code></pre>
  
  <p>This code works fine with all parameters filled. But how do I handle a null parameter if I don't want, for example, salsa and type in the url <code>localhost:port/nachos/1/cheese/tomatoes/hotsauce</code></p>