JavaScript 中的 SharedArrayBuffer.byteLength 屬性


SharedArrayBuffer 的 byteLength 屬性返回一個無符號 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 

更新於:30-Jul-2019

62 次瀏覽

開啟您的 職業生涯

透過完成課程獲得認證

開始
廣告
© . All rights reserved.