DataView byteOffset Property in JavaScript



The byteOffset property of the DataView represents the offset of the current DataView.

Syntax

Its syntax is as follows

dataView.byteOffset();

Example

Try the following example.

 Live Demo

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var arrayBuffer = new ArrayBuffer(114);
      var dataView = new DataView(arrayBuffer);
      document.write(dataView.buffer.byteLength);
   </script>
</body>
</html>

Output

114
Updated on: 2020-06-25T10:18:10+05:30

72 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements