js-util

Home > rc-js-util > arrayGenerateRange

arrayGenerateRange() function

Generates a range of integers output in an Array.

Signature:

export declare function arrayGenerateRange(from: number, to: number): number[];

Parameters

Parameter Type Description
from number The value to start from (inclusive).
to number The value to finish with (inclusive).

Returns:

number[]

An array [from, from + 1, …, to -1, to].

Remarks

Where from and to are equal a length 1 array is returned, NaN input is not supported.

See arrayGenerateRange().