JavaScript TypedArray.prototype.values() Method Last Updated : 10 Jun, 2024 Comments Improve Suggest changes Like Article Like Report 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()Parameter: Does not accept any parameter. Return Value:An array iterator object containing the values of each element in the typed array. Example 1: In the given below example we are iterating over values in Float32Array using value() method. JavaScript // Example usage of values() to // iterate over a Float32Array const float32Array = new Float32Array([0.1, 2.5, 3.7, 4.9, 5.5]); const iterator = float32Array.values(); const valuesArray = []; for (let value of iterator) { valuesArray.push(value); } console.log(valuesArray); Output[ 0.10000000149011612, 2.5, 3.700000047683716, 4.900000095367432, 5.5 ] Example 2: In the given below example we are iterating over values in Unit8Array. JavaScript // Example usage of values() to iterate over a Uint8Array const uint8Array = new Uint8Array([10, 20, 30, 40, 50]); const iterator = uint8Array.values(); for (let value of iterator) { console.log(value); } Output10 20 30 40 50 Comment More infoAdvertise with us Next Article JavaScript TypedArray.prototype.values() Method pankajbind Follow Improve Article Tags : JavaScript Web Technologies Similar Reads 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.toSorted() Method The toSorted() method, presented in ECMAScript 2023 or (ES2023) affords a secure and efficient manner of ordering elements of TypedArray in ascending order. The toSorted() method of TypedArray instances is the copying version of the sort() method, it gives back a new typed array with sorted elements 1 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 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.of() Method The typedArray.of() is an inbuilt function in JavaScript which is used to construct a new typedArray with a variable number of parameters. Syntax: TypedArray.of(element0, element1, ......) Parameters: It accepts parameters of different elements whose typedArray is going to be created. Return value: 1 min read JavaScript TypedArray.of() Method The TypedArray.of() method is used to create a new array from a variable number of arguments that are passed to it. Syntax: TypedArray.of( el0, el1, el2, ...elN ) Parameters: This method accepts a variable number of elements, which are used to create the Int16Array array. TypedArray can contain any 2 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 typedArray.sort() Method The typedArray.sort() is an inbuilt function in JavaScript which is used to sort the elements of the given typedArray and return the new typedArray with the sorted elements. Syntax: typedArray.sort(); Parameter: It does not accept any parameters. Return value: It returns the new typedArray with the 1 min read JavaScript typedArray.set() Method The typedArray.set() is an inbuilt function in JavaScript which is used to stores a number of values in the given typedArray. typedArray.set(typedArray, offset) Parameters: It accept two parameters which are specified below- typedarray: It is the source array. offset: It is optional and it is into t 1 min read Like