JavaScript TypedArray.prototype.includes() Method Last Updated : 10 Jun, 2024 Comments Improve Suggest changes Like Article Like Report 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)ParameterssearchElement: The value to search for. fromIndex: (Optional) The position in the array at which searching begins. If the value not given the default position will be considered as 0. Return ValueIf the element is found then it will return true otherwise it will return false. Example 1: In the given below example we are checking the presence of an element in Unit8Array. JavaScript // Example usage of includes() // to check for presence of an element const uint8Array = new Uint8Array([10, 20, 30, 40, 50]); const contains30 = uint8Array.includes(30); const contains60 = uint8Array.includes(60); console.log(contains30); // Output: true console.log(contains60); // Output: false Outputtrue false Example 2: In the given below example we are checking for the presence of a floating-point number in Float32Array. JavaScript // Example usage of includes() to check // for presence of a floating-point number const float32Array = new Float32Array([0.1, 2.5, 3.7, 4.9, 5.5]); const contains2Point5 = float32Array.includes(2.5); const contains6Point5 = float32Array.includes(6.5); console.log(contains2Point5); console.log(contains6Point5); Outputtrue false Comment More infoAdvertise with us Next Article JavaScript TypedArray.prototype.includes() Method P pankajbind Follow Improve Article Tags : JavaScript Web Technologies javaScript Similar Reads JavaScript TypedArray.prototype.findIndex() Method Method TypedArray.prototype.findIndex() of JavaScript returns the index of the first element in the typed array that fulfils the conditions specified by the testing function, if no elements satisfy it, -1 is returned, the findIndex() method takes a callback function as an argument and it returns an 2 min read JavaScript TypedArray.prototype.findLast() Method A new method, TypedArray.prototype.findLast(), was introduced in ECMAScript 2023 (ES2023). The method findLast() of instances TypedArray proceeds traverse over the typed array backwards and provides method returning the value of the first element that satisfies the supplied testing function. When th 2 min read JavaScript typedArray.includes() Method 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 specifi 2 min read JavaScript TypedArray.prototype.with() Method A new method TypedArray.prototype.with(), was introduced in ECMAScript 2023 (ES2023) to provide a means of modifying an element in a particular TypedArray without altering the underlying array directly, it generates a new TypedArray with the required alteration and then returns it. TypedArray instan 2 min read JavaScript TypedArray.prototype.values() Method TypedArray's values() method returns a new iterator object for the array, this iterator will allow you to traverse through typed arrays and generate the value of each element at every position and like values() method for normal JavaScript arrays, it serves a similar role. SyntaxtypedArray.values()P 1 min read Like