| 20 | } |
| 21 | |
| 22 | class 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 | |
| 32 | console.log('arraySplice([1, 2, 3], 1): %j', arraySplice([ 1, 2, 3 ], 1)); |
| 33 | console.log('new SubArray(1, 2, 3).spliceOne(1): %j', new SubArray(1, 2, 3).spliceOne(1)); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…