title: JavaScript does not take an account of the conditions exit, while variables are nevertheless equal to the output condition
body: <p>I have a HTML form that submit to a JavaScript, the data is processed and a POST request is sent to a PHP script.</p>
  
  <pre><code>var xmlHttp = new XMLHttpRequest();
          xmlHttp.onreadystatechange = function() {
              if(xmlHttp.readyState == 4 &amp;&amp; xmlHttp.status == 200) {
                  if(contentElt &amp;&amp; xmlHttp.responseText) {
                      var ajaxData = JSON.parse(xmlHttp.responseText);
                      var processedResultCount = parseInt(ajaxData[0]);
                      totalResultCount += processedResultCount;
  
                      contentElt.innerHTML = "Date processed (month - year): " + recupMonth + " - " + recupYear + "&lt;br/&gt;Results processed: " + processedResultCount + "&lt;br/&gt;Total results processed: " + totalResultCount;
  
                      pageNum++;
                      writeMode = "a";
  
                      if(processedResultCount === 0) {
                          pageNum = 1;
                          recupMonth--;
                          if(recupMonth === 0 &amp;&amp; recupYear &gt; endYear) {
                              recupMonth = 12;
                              recupYear--;
                          }
                          else if(recupMonth === endMonth &amp;&amp; recupYear === endYear) {
                              alert("Processing finished");
                              if(totalResultCount != 0) {
                                  contentElt.innerHTML = "Total processed results: " + totalResultCount + '&lt;br/&gt;&lt;br/&gt;&amp;gt; &lt;a href="amazon_keyword_stats.csv" title="Download CSV result file"&gt;Download CSV result file&lt;/a&gt;';
                              }
                              return;
                          }
                      }
  </code></pre>
  
  <p>when I arrive at the condition</p>
  
  <pre><code>else if(recupMonth === endMonth &amp;&amp; recupYear === endYear)
  </code></pre>
  
  <p>and the condition are satisfied.
  Code doesn't go in.</p>
  
  <p>continues to decrement the month and when it gets to -2, it still performs five iteration and then the code arette not offer a CSV download.</p>
  
  <p>I do not understand why it happens like that, someone would have a clue?</p>