MCPcopy Create free account
hub / github.com/angular/components / range

Function range

src/material/core/datetime/native-date-adapter.ts:34–40  ·  view source on GitHub ↗

Creates an array and fills it with values.

(length: number, valueFunction: (index: number) => T)

Source from the content-addressed store, hash-verified

32
33/** Creates an array and fills it with values. */
34function range<T>(length: number, valueFunction: (index: number) => T): T[] {
35 const valuesArray = Array(length);
36 for (let i = 0; i < length; i++) {
37 valuesArray[i] = valueFunction(i);
38 }
39 return valuesArray;
40}
41
42/** Adapts the native JS Date for use with cdk-based components that work with dates. */
43@Service({autoProvided: false})

Callers 3

getMonthNamesMethod · 0.70
getDateNamesMethod · 0.70
getDayOfWeekNamesMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected