DataView byteLength Property in JavaScript



The byteLength property of the DataView represents the length of the current Data View.

Syntax

Its syntax is as follows

dataView.byteLength();

Example

 Live Demo

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

Output

8
Updated on: 2020-06-25T10:18:46+05:30

117 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements