• Checks if value is in collection. If collection is a string, it's checked for a substring of value. If fromIndex is negative, it's used as the offset from the end of collection.

    Contribution to minified bundle size, when it is the only function imported:

    • Lodash: 5,533 bytes
    • Micro-dash: 344 bytes

    Type Parameters

    • T extends string | object | readonly any[]

    Parameters

    • collection: T
    • value: T extends readonly any[]
          ? T<T>[0]
          : T extends string
              ? string
              : T[keyof T]
    • fromIndex: number = 0

    Returns boolean