BigInt64Array
型の配列は、プラットフォームのバイト順で 64 ビット符号付き整数の配列を表します。バイト順を制御する必要がある場合は、代わりに DataView
を使用してください。内容は 0n
に初期化されます。一度確立されると、オブジェクトのメソッドを使って配列内の要素を参照するか、標準の配列インデックス構文を使って(つまり、角括弧記法を使って)配列を参照することができます。
コンストラクター
BigInt64Array()
- 新しい
BigInt64Array
オブジェクトを作成します
静的プロパティ
BigInt64Array.BYTES_PER_ELEMENT
- 要素サイズの数値を返します。
BigInt64Array
は8
です。 BigInt64Array.name
- コンストラクター名の文字列を返します。
BigInt64Array
は "BigInt64Array" です。
静的メソッド
BigInt64Array.from()
- array-like、あるいは iterable オブジェクトから新しい
BigInt64Array
を作成します。Array.from()
も参照してください。 BigInt64Array.of()
- 可変数の引数から新しい
BigInt64Array
を作成します。Array.of()
も参照してください。
インスタンスプロパティ
BigInt64Array.prototype.buffer
BigInt64Array
が参照するArrayBuffer
を返します。これは構築時に固定されているため、読み取り専用です。BigInt64Array.prototype.byteLength
BigInt64Array
のArrayBuffer
の先頭からの長さをバイト数で返します。これは構築時に固定されているため、読み取り専用です。BigInt64Array.prototype.byteOffset
BigInt64Array
のArrayBuffer
の先頭からのオフセットをバイト単位で返します。これは構築時に固定されているため、読み取り専用です。BigInt64Array.prototype.length
BigInt64Array
に保持されている要素数を返します。これは構築時に固定されているため、読み取り専用です。
インスタンスメソッド
BigInt64Array.prototype.copyWithin()
- 配列内の配列要素のシーケンスをコピーします。
Array.prototype.copyWithin()
も参照してください。 BigInt64Array.prototype.entries()
- 配列の各インデックスのキーと値のペアを含む、新しい
Array Iterator
オブジェクトを返します。Array.prototype.entry()
も参照してください。 BigInt64Array.prototype.every()
- 配列のすべての要素が、関数で指定されたテストに合格するかどうかをテストします。
Array.prototype.every()
も参照してください。 BigInt64Array.prototype.fill()
- 開始インデックスから終了インデックスまでの、配列のすべての要素を静的な値で埋めます。
Array.prototype.fill()
も参照してください。 BigInt64Array.prototype.filter()
- 指定したフィルターリング関数が
true
を返す要素をすべて含む、新しい配列を作成します。Array.prototype.filter()
も参照してください。 BigInt64Array.prototype.find()
- 配列内の要素が指定したテスト関数を満たしている場合は、配列内で見つかった値を返し、見つからなかった場合は
undefined
を返します。Array.prototype.find()
も参照してください。 BigInt64Array.prototype.findIndex()
- 配列内の要素が指定したテスト関数を満たす場合は、配列内で見つかったインデックスを返し、見つからなかった場合は -1 を返します。
Array.prototype.findIndex()
も参照してください。 BigInt64Array.prototype.forEach()
- 配列の各要素に対して関数を呼び出します。
Array.prototype.forEach()
も参照してください。 BigInt64Array.prototype.includes()
- 型付き配列が特定の要素を含むかどうかを判断し、適切な場合は
true
またはfalse
を返します。Array.prototype.includes()
も参照してください。 BigInt64Array.prototype.indexOf()
- 指定した値と等しい配列内の要素の最初の(最小の)インデックスを返します。何も見つからない場合は -1 を返します。
Array.prototype.indexOf()
も参照してください。 BigInt64Array.prototype.join()
- 配列のすべての要素を文字列に結合します。
Array.prototype.join()
も参照してください。 BigInt64Array.prototype.keys()
- 配列の各インデックスのキーを含む新しい
Array Iterator
を返します。Array.prototype.keys()
も参照してください。 BigInt64Array.prototype.lastIndexOf()
- 指定した値と等しい配列内の要素の最後の(最大の)インデックスを返します。何も見つからない場合は -1 を返します。
Array.prototype.lastIndexOf()
も参照してください。 BigInt64Array.prototype.map()
- この配列の各要素に対して指定した関数を呼び出した結果を持つ、新しい配列を作成します。
Array.prototype.map()
も参照してください。 BigInt64Array.prototype.reduce()
- アキュムレータと配列の各値(左から右へ)を一つの値に減らすための関数を適用します。
Array.prototype.reduce()
も参照してください。 BigInt64Array.prototype.reduceRight()
- アキュムレータと配列の各値(右から左へ)を一つの値に減らすための関数を適用します。
Array.prototype.reduceRight()
も参照してください。 BigInt64Array.prototype.reverse()
- 配列の要素の順序を反転させます — 最初が最後になり、最後が最初になります。
Array.prototype.reverse()
も参照してください。 BigInt64Array.prototype.set()
- 型付けされた配列に複数の値を格納し、指定した配列から入力値を読み込みます。
BigInt64Array.prototype.slice()
- 配列の一部を抽出し、新しい配列を返します。
Array.prototype.slice()
も参照してください。 BigInt64Array.prototype.some()
- 配列の少なくとも一つの要素が、指定したテスト関数を満たしている場合に
true
を返します。Array.prototype.some()
も参照してください。 BigInt64Array.prototype.sort()
- 配列の要素を所定の位置に並べ替えて、その配列を返します。
Array.prototype.sort()
も参照してください。 BigInt64Array.prototype.subarray()
- 指定した開始要素と終了要素のインデックスから、新しい
BigUint64Array
を返します。 BigInt64Array.prototype.values()
- 配列の各インデックスの値を含む、新しい
Array Iterator
オブジェクトを返します。Array.prototype.values()
も参照してください。 BigInt64Array.prototype.toLocaleString()
- 配列とその要素を表すローカライズされた文字列を返します。
Array.prototype.toLocaleString()
も参照してください。 BigInt64Array.prototype.toString()
- 配列とその要素を表す文字列を返します。
Array.prototype.toString()
も参照してください。 BigInt64Array.prototype[@@iterator]()
- 配列の各インデックスの値を含む、新しい
Array Iterator
オブジェクトを返します。
例
BigInt64Array の作成方法の違い
// length から
var bigint64 = new BigInt64Array(2);
bigint64[0] = 42n;
console.log(bigint64[0]); // 42n
console.log(bigint64.length); // 2
console.log(bigint64.BYTES_PER_ELEMENT); // 8
// 配列から
var arr = new BigInt64Array([21n,31n]);
console.log(arr[1]); // 31n
// 別の TypedArray から
var x = new BigInt64Array([21n, 31n]);
var y = new BigInt64Array(x);
console.log(y[0]); // 21n
// ArrayBuffer から
var buffer = new ArrayBuffer(32);
var z = new BigInt64Array(buffer, 0, 4);
// iterable なものから
var iterable = function*(){ yield* [1n, 2n, 3n]; }();
var bigint64 = new BigInt64Array(iterable);
// BigInt64Array[1n, 2n, 3n]
仕様
ブラウザーの互換性
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.