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

Method spliceOne

benchmark/array_splice.cjs:23–29  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

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));

Callers 1

array_splice.cjsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected