new DataView(buffer, byteOffset, byteLength)
Parameters: The function accepts three parameters which are described as below:
- buffer: An ArrayBuffer that is already existing to store the new DataView object.
- byteOffset (optional): offset(in bytes) in the buffer is used to start a new view of the buffer. By default, the new view starts from the first byte.
- byteLength (optional): It represents number of elements in the byte array. By default, the buffer’s length is considered as the length of the view.
Return value: It returns a new DataView object which will represent the specified data buffer.