<html>
<body>
<p>Subtract the numbers in the array, starting from the left:</p>
<p id="demo"></p>
<script>
var numbers = [175, 50, 25];
document.getElementById("demo").innerHTML = numbers.reduce(myFunc);
function myFunc(total, num) {
return total - num;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_reduce by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:01:27 GMT -->
</html>