title: Clothes size calculator in js
body: <p>I am now doing a clothes size calculator widget in js, now it checks for the values in the inputs using this</p>
  
  <pre><code>var sizes= [];
  //Array containing example sizes
  sizes[0] = ["XS", "1", "2", "4"];
  sizes[1] = ["S", "6", "7", "9"];
  sizes[2] = ["M", "11", "13", "15"];
  sizes[3] = ["L", "17", "19", "22"];
  sizes[4] = ["XL", "24", "27", "28"];
  sizes[5] = ["XXL", "30", "32", "34"];
  //In this function I receive values for the length, width and sleeve length from an HTML form and compare whether they are smaller than the clothes size
  function rightSize(lon, alt, sleeve){
    console.clear();
  
    for (i=0; i &lt; sizes.length; i++) {
      var rightLon = lon &lt; sizes[i][1];
      var rightAlt = alt &lt; sizes[i][1];
      var rightSleeve = sleeve &lt; sizes[i][1];
  
      console.log("iteration: " + i +  rightLon);
      console.log("iteration: " + i +  rightAlt);
      console.log("iteration: " + i +  rightSleeve);
      if(rightLon  &amp;&amp; rightAlt &amp;&amp; rightSleeve ){
          alert("Size: " + sizes[i][0]);
         break;
      }
    }
  }
  </code></pre>
  
  <p>But when I call it with almost every value it returns S as the correct value.</p>
  
  <p>EDIT: Here's the HTML form-</p>
  
  <pre><code>&lt;input type="number" name="largo" id="lon"&gt;
  &lt;input type="number" name="alto" id="alt"&gt;
  &lt;input type="number" name="ancho" id="sleeve"&gt;
  &lt;INPUT TYPE="button" NAME="button" Value="Click"onClick="rightSize(document.getElementById('lon').value, document.getElementById('alt').value, document.getElementById('sleeve').value)"&gt;
  </code></pre>