- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
TypedArray.reverse() function in JavaScript
The reverse() function of the TypedArray object reverses the contents of a typed array.
Syntax
Its Syntax is as follows
typedArray.reverse()
Example
<html> <head> <title>JavaScript Array every Method</title> </head> <body> <script type="text/javascript"> var typedArray = new Int32Array([11, 5, 13, 4, 15, 3, 17, 2, 19, 8 ]); document.write("Contents of the typed array: "+typedArray); document.write("<br>"); var result = typedArray.reverse(Math.sqrt); document.write("Contents of the reversed array: "+result); </script> </body> </html>
Output
Contents of the typed array: 11,5,13,4,15,3,17,2,19,8 Contents of the reversed array: 8,19,2,17,3,15,4,13,5,11
Advertisements
To Continue Learning Please Login
Login with Google