title: Node req.body.item exists, but if statement isn't firing
body: <p>I have a bootstrap form: </p>
  
  <pre class="lang-html prettyprint-override"><code>  &lt;form action="/users/dashboard" method="POST"&gt;
      &lt;div class="form-row"&gt;
        &lt;div class="col"&gt;
          &lt;div class="input-group"&gt;
            &lt;div class="input-group-prepend"&gt;
              &lt;label for="beginDate" class="input-group-text" id="beginDateLabel"&gt;From&lt;/label&gt;
            &lt;/div&gt;
            &lt;input type="date" name="beginDate" id="beginDate" aria-describedby="beginDateLabel"&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="col"&gt;
          &lt;div class="input-group"&gt;
            &lt;div class="input-group-prepend"&gt;
              &lt;label for="endDate" class="input-group-text" id="endDateLabel"&gt;To&lt;/label&gt;
            &lt;/div&gt;
            &lt;input type="date" name="endDate" id="endDate" aria-describedby="endDateLabel"&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="col"&gt;
          &lt;button class="btn btn-secondary" type="submit"&gt;Go&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>On the Node back end, I have an <code>if</code> statement looking for those two inputs:</p>
  
  <pre class="lang-js prettyprint-override"><code>let beginDate = new Date();
  beginDate.setMonth(beginDate.getMonth() - 5);
  if (req.body.beginDate) {
    const dateArr = req.body.beginDate.split('-');
    beginDate = new Date(parseInt(dateArr[0]),parseInt(dateArr[1]) - 1, 01);
  };
  
  let endDate = new Date();
  if (req.body.endDate) {
    const dateArr = req.body.endDate.split('-');
    endDate = new Date(parseInt(dateArr[0]),parseInt(dateArr[1] - 1), 01);
  };
  </code></pre>
  
  <p>The first <code>if</code> statement catches the <code>req.body.beginDate</code> just fine, but the second one is skipped entirely, even though that second input definitely has a value. Looking at it in the debugger it shows what I expect, a string of <code>'2020-03-08'</code> or whatever the selected date is.</p>
  
  <p>Any idea why that second <code>if</code> statement is being ignored?</p>