
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
ArrayBuffer Slice Function in JavaScript
ArrayBuffer object in JavaScript represents a fixed-length binary data buffer.The slice() method of the this object returns a portion or, chunk from the array buffer (as a separate object). It accepts two integer arguments representing the start (inclusive) and end (exclusive) of the portion of the array to be returned.
Syntax
Its syntax is as follows
arrayBuffer.slice(start, end);
Example
Try the following example.
<html> <head> <title>JavaScript Example</title> </head> <body> <script type="text/javascript"> var arrayBuffer = new ArrayBuffer(16); var int32View = new Int32Array(arrayBuffer); int32View[1] = 102; var sliced = new Int32Array(arrayBuffer.slice(4,12)); document.write(" "+sliced); </script> </body> </html>
Output
102,0
Advertisements