MCPcopy Index your code
hub / github.com/node-modules/utility / SubArray

Class SubArray

benchmark/array_splice.cjs:22–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22class SubArray extends Array {
23 spliceOne(index) {
24 for (let i = index, k = i + 1, n = this.length; k < n; i += 1, k += 1) {
25 this[i] = this[k];
26 }
27 this.pop();
28 return this;
29 }
30}
31
32console.log('arraySplice([1, 2, 3], 1): %j', arraySplice([ 1, 2, 3 ], 1));
33console.log('new SubArray(1, 2, 3).spliceOne(1): %j', new SubArray(1, 2, 3).spliceOne(1));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…