- 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.subarray() function in JavaScript
The subarray() function of the TypedArray object returns portion of the current array. It accepts two numbers representing the start and end of the sub array.
Syntax
Its Syntax is as follows
typedArray.subarray(5, 9)
Example
<html> <head> <title>JavaScript Example</title> </head> <body> <script type="text/javascript"> var typedArray = new Int32Array([111, 56, 62, 40, 75, 36, 617, 2, 139, 827 ]); var result = typedArray.subarray(3, 7); document.write("Contents of the typed array: "+result); </script> </body> </html>
Output
Contents of the typed array: 40,75,36,617
Advertisements