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

Function removeFromArray

packages/core/src/util/array_utils.ts:55–62  ·  view source on GitHub ↗
(arr: any[], index: number)

Source from the content-addressed store, hash-verified

53}
54
55export function removeFromArray(arr: any[], index: number): any {
56 // perf: array.pop is faster than array.splice!
57 if (index >= arr.length - 1) {
58 return arr.pop();
59 } else {
60 return arr.splice(index, 1)[0];
61 }
62}
63
64export function newArray<T = any>(size: number): T[];
65export function newArray<T>(size: number, value: T): T[];

Callers 4

removeMethod · 0.90
detachMethod · 0.90
destroyMethod · 0.90
detachViewFunction · 0.90

Calls 1

popMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…