~Array【型指定配列ビュー (%TypedArray%)】オブジェクト

メモ (外部リンク) 実装 コンストラクタ プロパティ メソッド 例 (プロパティ)

メモ

概要

その他ビュー

その他 配列・コレクション

関連


実装

実装名
%TypedArray%
要素
タイプ
BYTES_PER_ELEMENT
(各要素のバイト数)
[ @@toStringTag ]
タグ
同等のCの型
Int8ArrayInt81"Int8Array"8ビット 符号あり整数signed char
Uint8ArrayUint81"Uint8Array" 8ビット 符号なし整数unsigned char
Uint8ClampedArrayUint8C1"Uint8ClampedArray" 8ビット 符号なし整数
(clamped conversion)
unsigned char
Int16ArrayInt162"Int16Array"16ビット 符号あり整数short
Uint16ArrayUint162"Uint16Array" 16ビット 符号なし整数unsigned short
Int32ArrayInt324"Int32Array"32ビット 符号あり整数int
Uint32ArrayUint324"Uint32Array" 32ビット 符号なし整数unsigned int
Float32ArrayFloat324"Float32Array" 32ビット IEEE 浮動小数点数float
Float64ArrayFloat648"Float64Array" 64ビット IEEE 浮動小数点数double
BigInt64Array BigInt648"BigInt64Array" 64ビット 符号あり整数long int
BigUint64Array BigUint648"BigUint64Array" 64ビット 符号なし整数unsigned long int

コンストラクタ

構文備考
new %TypedArray%( )コンストラクタ
new %TypedArray%( length )コンストラクタ (サイズ指定)
new %TypedArray%( typedArray )コンストラクタ (コピー)
new %TypedArray%( object )コンストラクタ (変換)
new %TypedArray%( buffer [ , byteOffset [ , length ] ] ) コンストラクタ
(ArrayBuffer【バイナリデータ配列】指定)
参考関数備考
filter( callbackfn [ , thisArg ] )抽出生成
from( source [ , mapfn [ , thisArg ] ] ) オブジェクトから配列生成
map( callbackfn [ , thisArg ] ) 配列変換生成
of( ...items ) 配列生成

プロパティ

プロパティ説明
%TypedArray%[ @@species ] コンストラクタ定義 (下記 を参照)
[Symbol.species]
%TypedArray%.prototype[ @@toStringTag ] タグ (下記 を参照)
[Symbol.toStringTag]
%TypedArray%.prototype.buffer バッファ (ArrayBuffer【バイナリデータ配列】オブジェクト)
(下記 を参照)
%TypedArray%.prototype.byteLength ビューサイズ (バイト単位)
(下記 を参照)
%TypedArray%.prototype.byteOffset バッファオフセット (バイト単位)
(下記 を参照)
%TypedArray%.BYTES_PER_ELEMENT 各要素のバイト数 (下記 を参照)
%TypedArray%.prototype.BYTES_PER_ELEMENT
%TypedArray%.prototype.constructorコンストラクタ定義 (下記 を参照)
%TypedArray%.prototype.length 配列の要素数 (下記 を参照)
%TypedArray%.prototype プロトタイプ (下記 を参照)

メソッド

メソッド備考
%TypedArray%.prototype[ @@iterator ] ( )イテレータ取得
%TypedArray%.prototype. at ( index ) インデックス位置要素 取得
%TypedArray%.prototype. copyWithin(target, start [, end ] ) 内部コピー
%TypedArray%.prototype. entries( ) イテレータ取得 (キー・値)
%TypedArray%.prototype.every( callbackfn [ , thisArg ] ) 有効判定 (全要素有効)
%TypedArray%.prototype. fill(value [ , start [ , end ] ] ) 指定値設定
%TypedArray%.prototype. filter( callbackfn [ , thisArg ] )抽出生成
%TypedArray%.prototype. find(predicate [ , thisArg ] )値検索
%TypedArray%.prototype. findIndex( predicate [ , thisArg ] ) インデックス検索
%TypedArray%.prototype. findLast ( predicate [ , thisArg ] ) 値検索 (後方)
%TypedArray%.prototype. findLastIndex ( predicate [ , thisArg ] ) インデックス検索 (後方)
%TypedArray%.prototype. forEach( callbackfn [ , thisArg ] ) 要素処理
%TypedArray%. from( source [ , mapfn [ , thisArg ] ] ) オブジェクトから配列生成
%TypedArray%.prototype. includes( searchElement [ , fromIndex ] ) 存在確認
%TypedArray%.prototype. indexOf(searchElement [ , fromIndex ] )検索 (順方向)
%TypedArray%.prototype. join( separator ) 全要素文字列結合
%TypedArray%.prototype.keys( )イテレータ取得 (キー)
%TypedArray%.prototype. lastIndexOf( searchElement [ , fromIndex ] ) 検索 (逆方向)
%TypedArray%.prototype.map( callbackfn [ , thisArg ] ) 配列変換生成
%TypedArray%. of( ...items ) 配列生成
%TypedArray%.prototype. reduce( callbackfn [ , initialValue ] ) 隣接要素処理 (順方向)
%TypedArray%.prototype. reduceRight( callbackfn [ , initialValue ] ) 隣接要素処理 (逆方向)
%TypedArray%.prototype. reverse( ) 要素反転 (配列変更あり)
%TypedArray%.prototype. set ( source [ , offset ] ) 要素設定
%TypedArray%.prototype.slice( start [, end] ) 部分コピー
%TypedArray%.prototype.some( callbackfn [ , thisArg ] ) 有効判定 (一部要素有効)
%TypedArray%.prototype. sort( comparefn ) ソート (配列変更あり)
%TypedArray%.prototype.subarray( [ begin [ , end ] ] ) 部分ビュー
%TypedArray%.prototype. toLocaleString([ reserved1 [ , reserved2 ] ]) 文字列変換 (ロケール)
%TypedArray%.prototype. toReversed ( ) 要素反転 (配列変更なし)
%TypedArray%.prototype. toSorted ( comparefn ) ソート (配列変更なし)
%TypedArray%.prototype. toString( ) 文字列変換
%TypedArray%.prototype.values( )イテレータ取得 (値)
%TypedArray%.prototype. with ( index, value ) コピー&要素変更 (配列変更なし)

例 (プロパティ)

console.log( Int32Array[Symbol.species] );  // [ @@species ]
// 出力:ƒ Int32Array() { [native code] }
console.log( Int32Array.BYTES_PER_ELEMENT );
// 出力:4
console.log( Int32Array.prototype );
// 出力:TypedArray {BYTES_PER_ELEMENT: 4, Symbol(Symbol.toStringTag): undefined, constructor: ƒ}
const buff = new ArrayBuffer(32);
const typedArray = new Int32Array(buff, 8, 5);
console.log( typedArray[Symbol.toStringTag] );  // [ @@toStringTag ]
// 出力:Int32Array
console.log( typedArray.buffer );
// 出力:ArrayBuffer(32)
console.log( typedArray.buffer.byteLength );
// 出力:32
console.log( typedArray.byteLength );
// 出力:20
console.log( typedArray.byteOffset );
// 出力:8
console.log( typedArray.BYTES_PER_ELEMENT );
// 出力:4
console.log( typedArray.constructor );
// 出力:function Int32Array() { [native code] }
console.log( typedArray.length );
// 出力:5