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

    Function dropWhile

    • Drops while the element satisfies pred. If the element does not match pred, the rest of elements are yielded.

      Type Parameters

      • T

      Parameters

      • pred: (t: T) => boolean

        The condition to decide to drop from the list.

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

      The filtered list.

      Examples

      expect([
      ...toIterator(
      dropWhile((x: number) => x < 3)(
      fromArray([1, 2, 3, 4, 5, 1, 2, 3]),
      ),
      ),
      ]).toStrictEqual([3, 4, 5, 1, 2, 3]);
      expect(
      toArray(dropWhile((x: number) => x < 9)(fromArray([1, 2, 3]))),
      ).toStrictEqual(
      [],
      );
      expect(
      toArray(dropWhile((x: number) => x < 0)(fromArray([1, 2, 3]))),
      ).toStrictEqual(
      [1, 2, 3],
      );