@revideo/core / utils / range
Function: range()
Call Signature
range(
length):number[]
Defined in: utils/range.ts:12
Create an array containing a range of numbers.
Parameters
length
number
The length of the array.
Returns
number[]
Example
const array1 = range(3); // [0, 1, 2]
const array2 = range(-3); // [0, -1, -2]Call Signature
range(
from,to):number[]
Defined in: utils/range.ts:25
Create an array containing a range of numbers.
Parameters
from
number
The start of the range.
to
number
The end of the range. to itself is not included in the result.
Returns
number[]
Example
const array1 = range(3, 7); // [3, 4, 5, 6]
const array2 = range(7, 3); // [7, 6, 5, 4]Call Signature
range(
from,to,step):number[]
Defined in: utils/range.ts:39
Create an array containing a range of numbers.
Parameters
from
number
The start of the range.
to
number
The end of the range. to itself is not included in the result.
step
number
The value by which to increment or decrement.
Returns
number[]
Example
const array1 = range(1, 2, 0.25); // [1, 1.25, 1.5, 1.75]
const array2 = range(2, 1, -0.25); // [2, 1.75, 1.5, 1.25]