interface ReadonlyArray
Private

Type Parameters

Index Signatures

readonly [n: number] : T

Properties

readonly
length: number

Gets the length of the array. This is a number one higher than the highest element defined in an array.

Methods

toString(): string

Returns a string representation of an array.

Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.

concat(...items: ConcatArray<T>[]): T[]

Combines two or more arrays.

concat(...items: (T | ConcatArray<T>)[]): T[]

Combines two or more arrays.

join(separator?: string): string

Adds all the elements of an array separated by the specified separator string.

slice(
start?: number,
end?: number,
): T[]

Returns a section of an array.

indexOf(
searchElement: T,
fromIndex?: number,
): number

Returns the index of the first occurrence of a value in an array.

lastIndexOf(
searchElement: T,
fromIndex?: number,
): number

Returns the index of the last occurrence of a specified value in an array.

every<S extends T>(
predicate: (
value: T,
index: number,
array: readonly T[],
) => value is S
,
thisArg?: any,
): this is readonly S[]

Determines whether all the members of an array satisfy the specified test.

every(
predicate: (
value: T,
index: number,
array: readonly T[],
) => unknown
,
thisArg?: any,
): boolean

Determines whether all the members of an array satisfy the specified test.

some(
predicate: (
value: T,
index: number,
array: readonly T[],
) => unknown
,
thisArg?: any,
): boolean

Determines whether the specified callback function returns true for any element of an array.

forEach(
callbackfn: (
value: T,
index: number,
array: readonly T[],
) => void
,
thisArg?: any,
): void

Performs the specified action for each element in an array.

map<U>(
callbackfn: (
value: T,
index: number,
array: readonly T[],
) => U
,
thisArg?: any,
): U[]

Calls a defined callback function on each element of an array, and returns an array that contains the results.

filter<S extends T>(
predicate: (
value: T,
index: number,
array: readonly T[],
) => value is S
,
thisArg?: any,
): S[]

Returns the elements of an array that meet the condition specified in a callback function.

filter(
predicate: (
value: T,
index: number,
array: readonly T[],
) => unknown
,
thisArg?: any,
): T[]

Returns the elements of an array that meet the condition specified in a callback function.

reduce(callbackfn: (
previousValue: T,
currentValue: T,
currentIndex: number,
array: readonly T[],
) => T
): T

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

reduce(
callbackfn: (
previousValue: T,
currentValue: T,
currentIndex: number,
array: readonly T[],
) => T
,
initialValue: T,
): T
reduce<U>(
callbackfn: (
previousValue: U,
currentValue: T,
currentIndex: number,
array: readonly T[],
) => U
,
initialValue: U,
): U

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

reduceRight(callbackfn: (
previousValue: T,
currentValue: T,
currentIndex: number,
array: readonly T[],
) => T
): T

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

reduceRight(
callbackfn: (
previousValue: T,
currentValue: T,
currentIndex: number,
array: readonly T[],
) => T
,
initialValue: T,
): T
reduceRight<U>(
callbackfn: (
previousValue: U,
currentValue: T,
currentIndex: number,
array: readonly T[],
) => U
,
initialValue: U,
): U

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.