Function contains

  • Checks if the source contains a specific value.

    Type Parameters

    • T

      Type of items in the source.

    Parameters

    • value: T

      Value to check for.

    • equalsFunction: EqualsFunction<T> = ...

      Optional function to compare values.

    Returns CollectorFunction<T, boolean>

    Collector that checks if the source contains a specific value.

    const result = contains(2)([1, 2, 3]);
    console.log(result); // true