MCPcopy Create free account
hub / github.com/Faheem-Khan97/javascript-coding-problems-with-theory / chopInputArray

Function chopInputArray

utils/index.js:25–36  ·  view source on GitHub ↗
(arr, size)

Source from the content-addressed store, hash-verified

23}
24exports.reverseInPlace = reverseInPlace;
25function chopInputArray(arr, size) {
26 var res = [];
27 var startIndex = 0;
28 var endIndex = size - 1;
29 while (startIndex < arr.length) {
30 var r = arr.slice(startIndex, endIndex + 1);
31 res.push(r);
32 startIndex += size;
33 endIndex += size;
34 }
35 return res;
36}
37exports.chopInputArray = chopInputArray;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected