Demo entry 6719618

js

   

Submitted by lu on Mar 12, 2018 at 16:41
Language: JavaScript. Code size: 197 Bytes.

var numbers = [65, 44, 12, 4];
 
function getSum(total, num) {
    return total + num;
}
function myFunction(item) {
    document.getElementById("demo").innerHTML = numbers.reduce(getSum);
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).