Question: I'm a total JS noobie, and I'm trying to make it so that after one input is entered all of the numbers between 0 and that input are added up, including the input. Here is the basic pseudo code I'm trying to accomplish but i can't figure it out?

```
get count from user

loop up to count{

     add current number to sum

}

display sum

display breakline

loop up to count with a different loop type{

    add current number to sum

}

display sum

```

Answer: 
You could try something like this:

```
// input would be the number that the user will enter
var input = 10;

// the starting number is 0.
var temp = 0;

// the sum.
var sum = 0;

// while the temp would be less or equal to the input,
// then we will add the temp to the sum and we increase it by 1.
// This way, when temp would be equal to imput+1, the statement in 
// the while loop would be false, and the statements in the while loop 
// wouldn't be executed. At this moment, the sum would hold the sum of 
// the integers numbers in the range [0,input].
while(temp<=input)
{
    sum+=temp;
    temp++;
}

```

As for the part of displaying is totally depends on where you want to display the result.
If you want to display it on the console.

```
console.log(sum);

```

If you want to display it on an alert box.

```
alert(sum);

```

etc.
Here it is the full code displaying you want:

```html
<HTML>
<HEAD>
<TITLE>JavaScript Form - Input Text Field</TITLE>
<SCRIPT Language="JavaScript">
<!--//
function showAndClearField(frm){
  if (frm.num.value == "")
      alert("Hey! You didn't enter anything!")
  else{
    var result = 0;
  var input = frm.num.value; //However you do it.
  for (var i = 1; i <= input; i++) {
    result += i;
  }
      alert("Result: " + result)
  }
  frm.firstName.value = ""
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="test">
<H2>Enter a number.</H2>
<INPUT TYPE="Number" NAME="num"><BR><BR>
<INPUT TYPE="Button" Value="Show and Clear Input" onClick="showAndClearField(this.form)">
</P>
</FORM>
</BODY>
</HTML>
```