Equana

Docs/Arrays/arange
Back to Arrays

arange

Evenly spaced values over a half-open interval [start, stop).

Syntax

arange(start, stop, step) → Array [start, start+step, ...] up to but excluding stop

Backends

TypeScript

Description

Evenly spaced values over a half-open interval [start, stop).

Parameters

NameDescription
startStart value (inclusive); defaults to 0
stopStop value (exclusive)
stepSpacing between values; defaults to 1

Returns

Array [start, start+step, ...] up to but excluding stop

Examples

Try It
>> arange(5)
[0, 1, 2, 3, 4]
Try It
>> arange(1, 5)
[1, 2, 3, 4]
Try It
>> arange(0, 1, 0.25)
[0, 0.25, 0.5, 0.75]

See Also