MCPcopy Create free account
hub / github.com/appacademy/Module-1-Resources / restSum

Function restSum

w2/d2/rest-spread-repl.js:2–8  ·  view source on GitHub ↗
(...otherNums)

Source from the content-addressed store, hash-verified

1// * 1. RestSum
2const restSum = (...otherNums) => {
3 let sum = 0;
4 for (let num of otherNums) {
5 sum += num;
6 }
7 return sum;
8};
9
10// * 2. spreadItOut
11const spreadItOut = (array1, array2) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected