title: Issue with passing 0 in an array generated by JS/PHP Ajax request
body: <p>I have a script written in JQuery that makes an AJAX call to a PHP function. That function returns an array of data depending on the data sent to it.</p>
  
  <p>At the front end I have radio buttons with data attributes on them determining which index of the array to fetch and then output to the screen.</p>
  
  <p>The issue is that it won't use <code>0</code> as a number to fetch. By starting the array with a blank value and increasing the number to fetch by one, everything works as it should.</p>
  
  <p>My question is, why won't <code>0</code> be parsed by the Javascript to fetch the right data. My theory is that is has something to do with <code>0</code> being identical to false, however, I'd expect 1 to be similar and return true.</p>
  
  <p>I've tried using <code>parseInt(0, 10)</code> when fetching the data. I also tried using <code>!isNan(parseInt(0, 10))</code> to try and negate the false value.</p>
  
  <p>A basic version of what I am using is below. I've left out the AJAX call as that works fine and I don't think that is the problem.</p>
  
  <p>html</p>
  
  <pre><code>&lt;input type="radio" data-description-id="0" name="radio" /&gt;
  &lt;input type="radio" data-description-id="1" name="radio" /&gt;
  &lt;input type="radio" data-description-id="2" name="radio" /&gt;
  // Etc
  </code></pre>
  
  <p>javascript</p>
  
  <pre><code>$(document).on('change', 'input[type=radio]', function(event) {
      var evt = event;
      if($(evt.currentTarget).data('description-id')) {
          var $_correctDescriptionID = parseInt($(evt.target).data('description-id'), 10),
          $_injuryDescriptionContainer = $('.icc__injury-description span');
          $_injuryDescriptionContainer.text($_injuryDescriptions[$_correctDescriptionID]);
      }
  
      console.log($_correctCompensationAmount);
      console.log($_correctDescriptionID);
  
  });
  </code></pre>
  
  <p>Example Array</p>
  
  <pre><code>{
      [0] =&gt; "Description one"
      [1] =&gt; "Description two"
      [2] =&gt; "Description three"
  }
  </code></pre>
  
  <p>Expected results are as follows:
  - When clicking on a radio button it would set the text of p tag to the corresponding text in the array.
  - Therefore if you choose input 2, you'd get "Description two" etc.</p>
  
  <p>It fetches the correct data, however the first value is ignored, essentially the <code>[0]</code> in the array. So clicking on radio button 1 returns undefined, but clicking on radio button 2, you get "Description two".</p>