js-util

Home > rc-js-util > arrayForEachRange

arrayForEachRange() function

Like arrayForEach() with integer range as input.

Signature:

export declare function arrayForEachRange(from: number, to: number, callback: (value: number, index: number) => void): void;

Parameters

Parameter Type Description
from number The value to start from (inclusive).
to number The value to finish with (inclusive).
callback (value: number, index: number) => void Called for each value in the range.

Returns:

void

Remarks

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

See arrayForEachRange().