MCPcopy Index your code
hub / github.com/angular/angular / arraySplice

Function arraySplice

packages/core/src/util/array_utils.ts:87–96  ·  view source on GitHub ↗
(array: any[], index: number, count: number)

Source from the content-addressed store, hash-verified

85 * @param count Number of items to remove.
86 */
87export function arraySplice(array: any[], index: number, count: number): void {
88 const length = array.length - count;
89 while (index < length) {
90 array[index] = array[index + count];
91 index++;
92 }
93 while (count--) {
94 array.pop(); // shrink the array
95 }
96}
97
98/**
99 * Same as `Array.splice(index, 0, value)` but faster.

Callers 4

expectArraySpliceFunction · 0.90
removeFromQueueMethod · 0.90
callbackMethod · 0.90
keyValueArrayDeleteFunction · 0.85

Calls 1

popMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…