Computer >> Computer tutorials >  >> Programming >> Javascript

TypedArray.byteLength property in JavaScript


The byteLength property of the TypedArray object represents the length of its(in bytes)TypedArray.

Syntax

Its Syntax is as follows

typedArray.byteLength();

Example

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var buffer = new ArrayBuffer(156);
      var float32 = new Float32Array(buffer);
      document.write(float32.byteLength);
   </script>
</body>
</html>

Output

156