Multiply all numbers in an array javascript

Javascript array with for loop

<script>
function multiply(array) {
    var total = 1;
    for (var i = 0; i < array.length; i++) {
        total = total * array[i];
    }
    return 'Total '+total;
}

document.write(multiply([10, 8, 6, 5]));
</script>

</body>
</html>

Related Sourcecode

More Sourcecode

×
Google login
SignUp with Email
X