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

    Function reverse

    • Reverses the list. If the list is infinite, it will hang forever.

      Type Parameters

      • T

      Parameters

      Returns List.List<T>

      The reversed list.

      Examples

      expect(reverse(empty())).toStrictEqual(empty());
      expect(toArray(reverse(fromArray([1, 4, 2, 3])))).toStrictEqual([3, 2, 4, 1]);
      expect(toArray(reverse(fromString("hoge")))).toStrictEqual(["e", "g", "o", "h"]);