title: Adding splitted values in loops
body: <p><a href="https://i.stack.imgur.com/PI3NI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PI3NI.png" alt="enter image description here"></a></p>
  
  <p>I suggest u look at this picture, and then u look at the code I have written:</p>
  
  <pre><code>function addNumbers() {
      var splitted = document.getElementById("listInput").value.split(" ");
  
      for(i = 0; i &lt;= splitted.length; i+=1) {
          document.getElementById("resultNumberTotal").value = splitted[i];
      }
  }
  </code></pre>
  
  <p>I am taking the value from the box which says "Enter list of numbers and/or words" and I am splitting it. I split it so I have all the numbers like this "1 2 3" and so I can add them. I use the for loop for that. The for loop goes through every number and then it adds it. But when I press the button, it shows me undefined. </p>
  
  <p>Why am I getting undefined?</p>