Edit

JavaScript Variables

JavaScript variables are containers which are used to store data values.

In this example, a, b, and sum, are variables:

<p id="test"></p>
<script>
var a = 2;
var b = 3;
var sum = a + b;
document.getElementById("test").innerHTML =
"The value of sum is: " + sum;
</script>

Output