Function contains

  • Checks if the value is in collection.

    Returns

    Returns true if value is found, else false.

    Example

    contains([1, 2, 3], 1)
    // true

    contains([1, 2, 3], 1, 2)
    // false

    contains({ 'a': 1, 'b': 2 }, 1)
    // true

    contains('abcd', 'bc')
    // true

    See

    find

    Parameters

    • collection: Iterable<any>

      The collection to inspect.

    • value: any

      The value to search for.

    Returns any

Generated using TypeDoc