pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/byteLength

e="module">

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

ArrayBuffer.prototype.byteLength

Baseline 広く利用可能

この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2015年7月以降、すべてのブラウザーで利用可能です。

byteLength は、ArrayBuffer のアクセサープロパティで、この配列バッファーの長さをバイト単位で表します。

試してみましょう

// ArrayBuffer をバイト単位のサイズで作成
const buffer = new ArrayBuffer(8);

// byteLength でサイズを確認
const bytes = buffer.byteLength;

console.log(bytes);
// 予想される結果: 8

解説

byteLength プロパティはアクセサープロパティで、設定アクセサー関数が undefined であるため、このプロパティは読み取ることしかできません。値は配列が構築されるときに設定され、変更することができません。この ArrayBuffer が取り外された場合、このプロパティは 0 を返します。

byteLength の使用

js
const buffer = new ArrayBuffer(8);
buffer.byteLength; // 8

仕様書

仕様書
ECMAScript® 2027 Language Specification
# sec-get-arraybuffer.prototype.bytelength

ブラウザーの互換性

関連情報

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy