Hex Core JS
    Preparing search index...

    Function range

    • Returns an array of numbers from zero to the given maximum (exclusive). If a negative number is passed, the range returned is in decreasing order (starting at zero).

      Parameters

      • max: number

        The maximum (exclusive) of the range.

      Returns number[]

    • Returns an array of numbers from the given minimum (inclusive) to the given maximum (exclusive). If the minimum is greater than the maximum, the range returned is in decreasing order.

      Parameters

      • min: number

        The minimum (inclusive) of the range.

      • max: number

        The maximum (exclusive) of the range.

      Returns number[]

    • Returns an array of numbers from the given minimum (inclusive) to the given maximum (exclusive) incrementing by the step each time. If the direction of the bounds and the step do not match (e.g. range(10, 5, 2) or range(5, 10, -1)), an empty array is returned.

      Parameters

      • min: number

        The minimum (inclusive) of the range.

      • max: number

        The maximum (exclusive) of the range.

      • step: number

        The number to increment each element by.

      Returns number[]