Function polyArrIncludes

  • The polyArrIncludes() method determines whether an array includes a certain value among its entries, returning true or false as appropriate. Note: The polyfill does not handle NaN correctly.

    Type Parameters

    • T

    Parameters

    • theArray: ArrayLike<T>

      The array or array like object of elements to be searched.

    • searchElement: T

      The value to search for

    • Optional fromIndex: number

      The optional Zero-based index at which to start searching, converted to an integer.

      • Negative index counts back from the end of the array — if fromIndex < 0, fromIndex + array.length is used. However, the array is still searched from front to back in this case.
      • If fromIndex < -array.length or fromIndex is omitted, 0 is used, causing the entire array to be searched.
      • If fromIndex >= array.length, the array is not searched and false is returned.

    Returns boolean

    A boolean value which is true if the value searchElement is found within the array (or the part of the array indicated by the index fromIndex, if specified).

    Since

    0.8.0