ArrayBuffer【バイナリデータ配列】オブジェクト
メモ (外部リンク) コンストラクタ プロパティ 一覧 メソッド 一覧 例
メモ
- バイナリデータの配列
- 直接の操作は不可
- バイナリデータを高速に扱うためにビューを介して使用
- クラス定義による継承可能
- ビュー
- 参考:その他 配列・コレクション
外部リンク
ECMAScript (英語)
ArrayBuffer Objects | ||
---|---|---|
ES2022 (13) | ES2021 (12) | ES2020 (11) |
コンストラクタ
構文 | 説明 |
---|---|
new ArrayBuffer( length ) | コンストラクタ |
プロパティ 一覧
(下記 例を参照)
プロパティ | 説明 | |
---|---|---|
ArrayBuffer | [ @@species ] | コンストラクタ定義 [Symbol.species] |
ArrayBuffer.prototype | [ @@toStringTag ] | タグ [Symbol.toStringTag] |
ArrayBuffer.prototype. | byteLength | バイトサイズ |
ArrayBuffer.prototype. | constructor | コンストラクタ定義 |
ArrayBuffer. | prototype | プロトタイプ |
メソッド 一覧
メソッド | 説明 | |
---|---|---|
ArrayBuffer. | isView( arg ) | ビュー判定 |
ArrayBuffer.prototype. | slice( start, end ) | 部分コピー |
例 (プロパティ)
// [ @@species ]
console.log(ArrayBuffer[Symbol.species]);
// 出力:function ArrayBuffer() { [native code] }
console.log(ArrayBuffer.prototype);
// 出力:ArrayBuffer
// 出力: byteLength:(...)
// 出力: constructor:ArrayBuffer()
// 出力: slice:slice()
// 出力: Symbol(Symbol.toStringTag):"ArrayBuffer"
// 出力: get byteLength:byteLength()
// 出力: __proto__:Object
var arrayBuffer = new ArrayBuffer(100);
// [ @@toStringTag ]
console.log(arrayBuffer[Symbol.toStringTag]);
// 出力:ArrayBuffer
console.log(arrayBuffer.byteLength);
// 出力:100
console.log(arrayBuffer.constructor);
// 出力:function ArrayBuffer() { [native code] }