title: javascript for loop is not incrementing
body: <p>I am trying to using a for loop for trying to validate the input of the user and this is the code i got.</p>
  
  <pre><code>function Valid() {
    objfieldid = ["userMail", "userCont"]
    objboxid = ["cancelMail", "cancelCont"]
    return objfieldid.every(callnonvalid)
  }
  function callnonvalid(id) {
    var valid = false
    var objlength = objfieldid.length
    objlength--;
    for (var i = objlength; i &gt;= 0; i--){
      var cobj = document.getElementById(objboxid[i]).checked;
      if (document.getElementById(id).value != "" ){
        var obj = document.getElementById(id).value;
      } else if (cobj == true) {
        alert(i); //return 1, 1
        return true
      } else {
        return false
      }
    }
  }
  </code></pre>
  
  <p>As you can see, in the code, the for loop is running twice. but the i variable is left unchanged. Why would this happen?</p>
  
  <p>btw, I did read different material about closure and i am sure there didnt got a closure problem</p>
  
  <p>EDIT:guys please note that i did noticed the array is zero based, and i did minus the objlength by one. </p>