ArrayBuffer is used to represent a generic, fixed-length raw binary data buffer. The contents of an ArrayBuffer cannot be directly manipulated and can only be accessed through a DataView Object or one of the typed array objects. These Objects are used to read and write the contents of the buffer.
Parameters: It takes one parameter.
- byteLen: It is the byte length of the ArrayBuffer.
Return Type: It returns an ArrayBuffer object.
Example: This example creates an ArrayBuffer object
const buffer =
const view =
Int32Array(2) [ 0, 0 ]
|Returns the ArrayBuffer object
- Instance Property: An instance property is a property that has a new copy for every new instance of the class.
|Returns the ArrayBuffer constructor function for the object
|Specifies the byte length of the ArrayBuffer
|Specified the max length to which the size of ArrayBuffer can be increased in bytes
|Returns a boolean which tells whether the array can be resized
- Static Methods: If the method is called using the ArrayBuffer class itself then it is called a static method.
|It checks given an argument for the function is a typed array or not.
- Instance Methods: If the method is called on an instance of an ArrayBuffer then it is called an instance method.
|Resizes the ArrayBuffer if possible
|Returns new ArrayBuffer with the sliced value
Share your thoughts in the comments
Please Login to comment...