MCPcopy Create free account
hub / github.com/arguiot/TheoremJS / reshape

Method reshape

__test__/theorem.js:1341–1347  ·  view source on GitHub ↗
(array, part)

Source from the content-addressed store, hash-verified

1339 return this.arange(0, n, 1);
1340 }
1341 reshape(array, part) {
1342 const tmp = [];
1343 for (let i = 0; i < array.length; i += part) {
1344 tmp.push(array.slice(i, i + part));
1345 }
1346 return tmp;
1347 }
1348 reverse(array) {
1349 return array.slice(0).reverse() // duplicate and reverse to duplicate the array
1350 }

Callers 1

test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected