byteLength คุณสมบัติของ SharedArrayBuffer จะคืนค่าจำนวนเต็ม 32 บิตที่ไม่ได้ลงชื่อซึ่งระบุขนาด/ความยาวของ SharedArrayBuffer
ไวยากรณ์
ไวยากรณ์ของมันคือดังต่อไปนี้
sharedArrayBuffer.byteLength
ตัวอย่าง
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var sharedArrayBuffer = new SharedArrayBuffer(8);
var result = sharedArrayBuffer.byteLength;
document.write("length of the shared array buffer is: " + result);
</script>
</body>
</html>
ผลลัพธ์
length of the shared array buffer is: 8