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

Function newArray

packages/core/src/util/array_utils.ts:66–72  ·  view source on GitHub ↗
(size: number, value?: T)

Source from the content-addressed store, hash-verified

64export function newArray<T = any>(size: number): T[];
65export function newArray<T>(size: number, value: T): T[];
66export function newArray<T>(size: number, value?: T): T[] {
67 const list: T[] = [];
68 for (let i = 0; i < size; i++) {
69 list.push(value!);
70 }
71 return list;
72}
73
74/**
75 * Remove item from array (Same as `Array.splice()` but faster.)

Callers 5

_ownParametersMethod · 0.90
ɵɵprojectionDefFunction · 0.90

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…