I know you can use arrays but is there a way to declare multiple variables quickly - lets say up to 50 using a loop and an integer at the end of each variable going up by one every time.
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Variables</h1>
<p id="demo"></p>
<script>
var price1 = 5;
var price2 = 6;
var price3 = 7;
var price4 = 8;
var price5 = 4;
var price6 = 1;
var price7 = 9;
var price8 = 8;
var total = price1 + price2 + price3 + price4 + price5 + price6 + price7 + price8;
document.getElementById("demo").innerHTML =
"The total is: " + total;
</script>
</body>
</html>