• Returns whether the given array includes the given element

    Type Parameters

    • E

    Parameters

    • Optionalarray: null | E[] | readonly E[]

      the array to check

    • Optionalelement: null | E

      the element to compare

    Returns boolean

    whether the given array includes the given element

    includes(['foo', 'bar'], 'foo');    // true