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

    Function map

    • Maps the function from T to U onto List.

      Type Parameters

      • T
      • U

      Parameters

      • f: (t: T) => U

        The function to be mapped.

      Returns (list: List.List<T>) => List.List<U>

      The function mapped on List.

      Examples

      const mapped = toIterator(map((x: number) => x * 3 + 1)(iota));
      expect(mapped.next()).toStrictEqual({ value: 1, done: false });
      expect(mapped.next()).toStrictEqual({ value: 4, done: false });
      expect(mapped.next()).toStrictEqual({ value: 7, done: false });
      expect(mapped.next()).toStrictEqual({ value: 10, done: false });