Uint8Array.prototype.includes

Determines whether a typed array includes a certain element.

Syntax

includes(element, startIndex?)

Parameters

Return value

Returns true if the array contains the element, false if it doesn’t.

Examples

new Uint8Array([1, 2, 3]).includes(1)
true
new Uint8Array([1, 2, 3]).includes(42)
false