Programming Code Center(PCC)
[JS]

(PCC)::[How-to-use-JavaScript-variables-as-algebra]::[js]

File Name : index.html

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Variables</h2>

<p id="demo"></p>

<script>
var price1 = 5;
var price2 = 6;
var total = price1 + price2;
document.getElementById("demo").innerHTML =
"The total is: " + total;
</script>

</body>
</html>


Output :

JavaScript Variables