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: 25-Jun-2020

74 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements