title: Why does the comparision between two positions in an array is wrong if one position value's isn't 1?
body: <p>I'm starting to learn Javascript and i'm developing a simple code that alerts you which number is the bigger one, but i don't know why does the comparision between the position 0 and 1 always equals to position 0 being bigger if it's value isnt 1, for example if the position 0 = 5 and the position 1 = 10 the result is that the position 0 is the bigger one, but if the position 0 = 1 and the position 1 = anything bigger than 1 the result is that the position 1 is the bigger one. I don't know why it only happens with the comparision between the positions 0 and 1 and not with the comparision between 1 and 2.</p>
  <pre><code>var maths = document.getElementById('nMaths');
  var language = document.getElementById('nLanguage');
  var history = document.getElementById('nHistory');
  var numNotes = [maths.value,language.value,history.value];
  var aux;
  var biggest;
  for(var i = 0; i &lt; 3; i++){
      if (numNotes[i] &lt; numNotes[i+1]){
          aux = numNotes[i];
          numNotes[i] = numNotes[i+1];
          numNotes[i+1] = aux;
      }
  }
  for(var i = 0; i &lt; 3; i++){
      if (numNotes[i] &lt; numNotes[i+1]){
          aux = numNotas[i];
          numNotes[i] = numNotes[i+1];
          numNotes[i+1] = aux;
       }
  }
  alert(numNotes[0]);
  alert(numNotes[1]);
  alert(numNotes[2]);
  biggest = &quot;The biggest note is &quot; + numNotes[0];
  alert(biggest);
  </code></pre>