JavaScript typedArray.includes() Method Last Updated : 10 Feb, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The typedArray.includes() is an inbuilt function in JavaScript which is used to check whether a particular element is included by the given typedArray or not and accordingly it returns true and false. Syntax: typedarray.includes(Element, Index); Parameters: It accepts two parameter which are specified below- Element: It is the element which are being searched in the typedArray.Index: It is the index of the element in the typedArray form where search should start. Its default value is zero (0) and it is optional. Return value: It returns a boolean value true if the element is present in the given typedArray otherwise returns false. Example 1: javascript // Creating some typedArrays const A = new Uint8Array([ 1, 2, 3, 4, 5 ]); const B = new Uint8Array([ 5, 10, 15, 20 ]); const C = new Uint8Array([ 0, 2, 4, 6,, 8, 10 ]); const D = new Uint8Array([ 1, 3, 5, 7, 9 ]); // Calling include() function a = A.includes(2) b = B.includes(15, 1) c = C.includes(6) d = D.includes(9, 1) // Printing true or false, either the element // is present in the typedArray or not console.log(a); console.log(b); console.log(c); console.log(d); Output: true true true true Example 2: javascript // Creating some typedArrays const A = new Uint8Array([ 1, 2, 3, 4, 5 ]); const B = new Uint8Array([ 5, 10, 15, 20 ]); const C = new Uint8Array([ 0, 2, 4, 6,, 8, 10 ]); const D = new Uint8Array([ 1, 3, 5, 7, 9 ]); // Calling include() function a = A.includes(6) b = B.includes(21, 1) c = C.includes(6, 4) d = D.includes(0) // Printing true or false, either the element // is present in the typedArray or not console.log(a); console.log(b); console.log(c); console.log(d); Output: false false false false Comment More infoAdvertise with us Next Article JavaScript Array includes() Method K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies javascript-typedArray JavaScript-Methods Similar Reads JavaScript typedArray.indexOf() Method The typedArray.indexOf() is an inbuilt function in JavaScript which is used to return the index of the element if found in the given typedArray otherwise it returns -1. Syntax: typedarray.indexOf(Element, Index); Parameters: It accepts two parameter which are specified below- Element: It is the elem 2 min read JavaScript TypedArray.prototype.includes() Method In JavaScript the TypedArray.prototype.includes() method is used to check that the given typed array contains a specific given element or not, if it contains the element it returns true otherwise false. SyntaxtypedArray.includes(searchElement)ORtypedArray.includes(searchElement, fromIndex)Parameters 1 min read JavaScript String includes() Method The includes() method returns true if a string contains a specified string. Otherwise, it returns false.Note: The includes() method is case sensitive i.e. it will treat the Uppercase Characters and Lowercase Characters differently.Syntax:string.includes(searchvalue, start)Parameters:search value: It 3 min read JavaScript typedArray.some() Method The typedArray.some() is an inbuilt function in JavaScript which is used to check whether some elements of the typedArray satisfy the test implemented by the given function. Syntax: typedarray.some(callback) Parameters: It takes the parameter callback function and this callback function takes three 2 min read JavaScript Array includes() Method The includes() method in JavaScript returns true if an array contains a specified value, and false if the value is not found. This method simplifies checking for the presence of an element within an array, offering a quick and efficient way to return a boolean result. Syntaxarray.includes(searchElem 3 min read JavaScript typedArray.from() Property The typedArray.from() is an inbuilt function in JavaScript which is used to construct a new typedArray from a normal array or any iterable object. List of different typedArrays are specified in the table below: Int8Array();Int16Array();Uint32Array();Uint8Array();Uint16Array();Float32Array();Uint8Cla 2 min read Like