Function skipWhile

  • Skips elements from the source while the predicate returns true.

    Type Parameters

    • T

      Type of items in the source.

    Parameters

    • predicate: PredicateFunction<T>

      Predicate function to determine if an element should be skipped.

    Returns OperationFunction<T, T>

    Operation that skips elements from the source while the predicate returns true.

    const result = skipWhile<number>((x) => x < 3)([1, 2, 3, 4]);
    console.log([...result]); // [3, 4]