Thuộc tính BYTES_PER_ELEMENT của Mảng đã nhập biểu thị số byte trong mỗi phần tử trong đó.
Cú pháp
Cú pháp của nó như sau
Float32Array.BYTES_PER_ELEMENT;
Ví dụ
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var sizeOfFloat64Array = Float32Array.BYTES_PER_ELEMENT;
document.write("Size of the float 32 array: "+sizeOfFloat64Array);
document.write("<br>");
var sizeOfInt16Array = Int16Array.BYTES_PER_ELEMENT;
document.write("Size of the int 16 array: "+sizeOfInt16Array);
</script>
</body>
</html> Đầu ra
Size of the float 32 array: 4 Size of the int 16 array: 2