MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / sum

Function sum

code/intro.js:15–20  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

13}
14
15function sum(array) {
16 var total = 0;
17 for (var i = 0; i < array.length; i++)
18 total += array[i];
19 return total;
20}
21
22function factorial(n) {
23 if (n == 0) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected