MCPcopy Create free account
hub / github.com/Comcast/Speed-testJS / meanCalculator

Function meanCalculator

public/lib/uploadHttpConcurrentProgress.js:410–420  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

408 }
409
410 function meanCalculator(arr) {
411 var peakValue = arr[arr.length - 1];
412 var sum = arr.reduce(function(a, b) {
413 return a + b;
414 }, 0);
415 var mean = sum / arr.length;
416 return {
417 mean: mean,
418 peakValue: peakValue
419 };
420 }
421
422 function numericComparator(a, b) {
423 return (a - b);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected