JavaScript TypedArray.prototype.toReversed() Method Last Updated : 12 Feb, 2024 Comments Improve Suggest changes Like Article Like Report In JavaScript, Array.prototype.toReversed() method is used to reverse an array. It returns a new array that has elements in reverse order. Syntax :toReversed()Parameter:This method does not accept any parameter. Return Value:This method returns a newly formed reverse array. Example: This example shows the reverse of an array by the use of the Array.prototype.toReversed() method. JavaScript Uint8Array.prototype.toReversed = function () { const Arrays = new Uint8Array(this.length); for (let i = 0; i < this.length; i++) { Arrays[i] = this[this.length - 1 - i]; } return Arrays; }; // Example usage of toReversed() method const originalArray = new Uint8Array([1, 2, 9, 4, 5]); const Arrays = originalArray.toReversed(); console.log("Original Array:", originalArray); console.log("Reversed Array:", Arrays); OutputOriginal Array: Uint8Array(5) [ 1, 2, 9, 4, 5 ] Reversed Array: Uint8Array(5) [ 5, 4, 9, 2, 1 ] Comment More infoAdvertise with us Next Article JavaScript TypedArray.prototype.toReversed() Method S subramanyasmgm Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Methods Similar Reads 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.reverse() Method The typedArray.reverse() is an inbuilt function in JavaScript which is used to reverse the given typedArray elements i.e, first element becomes the last and vice versa. Syntax: typedArray.reverse(); Parameter: It does not accept any parameters. Return value: It returns the new reversed typedArray. E 1 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.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.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 Like