@mikuroxina/mini-fn
    Preparing search index...

    Function range

    • Creates the list of numbers from start to end with stepping, adding by step.

      Parameters

      • start: number

        The start of the range (inclusive).

      • end: number

        The end of the range (exclusive).

      • step: number = 1

        The steps of the numbers. Defaults to 1. Setting step to 0 will make the list infinite.

      Returns List.List<number>

      The list of numbers in the range.

      Examples

      expect(toArray(range(0, 5))).toStrictEqual([0, 1, 2, 3, 4]);
      expect(toArray(range(0, 5, 0.5))).toStrictEqual([
      0,
      0.5,
      1,
      1.5,
      2,
      2.5,
      3,
      3.5,
      4,
      4.5,
      ]);
      expect(toArray(range(2, 3))).toStrictEqual([2]);
      expect(toArray(range(3, 6))).toStrictEqual([3, 4, 5]);
      expect(toArray(range(3, 3))).toStrictEqual([]);
      expect(toArray(range(5, 0))).toStrictEqual([]);
      expect(toArray(range(3, 2))).toStrictEqual([]);