MCPcopy Create free account
hub / github.com/betomoedano/JavaScript-Coding-Interview-Questions / sumSpeeds

Function sumSpeeds

arrays/tandem-bicycle.js:31–39  ·  view source on GitHub ↗
(red, blue)

Source from the content-addressed store, hash-verified

29}
30
31function sumSpeeds(red, blue) {
32 let sum = 0;
33 for (let i = 0; i < red.length; i++) {
34 const currentRed = red[i];
35 const currentBlue = blue[i];
36 sum += Math.max(currentBlue, currentRed);
37 }
38 return sum;
39}
40
41console.log(tandemBicycle(redShirtSpeeds, blueShirtSpeeds, fastest));

Callers 1

tandemBicycleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected