--- title: BigInt64Array slug: Web/JavaScript/Reference/Global_Objects/BigInt64Array tags: - BigInt - BigInt64Array - Class - JavaScript - Reference - TypedArray - TypedArrays translation_of: Web/JavaScript/Reference/Global_Objects/BigInt64Array --- <div>{{JSRef}}</div> <p><strong><code>BigInt64Array</code></strong> 型の配列は、プラットフォームのバイト順で 64 ビット符号付き整数の配列を表します。バイト順を制御する必要がある場合は、代わりに {{jsxref("DataView")}} を使用してください。内容は <code>0n</code> に初期化されます。一度確立されると、オブジェクトのメソッドを使って配列内の要素を参照するか、標準の配列インデックス構文を使って(つまり、角括弧記法を使って)配列を参照することができます。</p> <h2 id="Constructor" name="Constructor">コンストラクター</h2> <dl> <dt><a href="/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array"><code>BigInt64Array()</code></a></dt> <dd>新しい <code>BigInt64Array</code> オブジェクトを作成します</dd> </dl> <h2 id="Static_properties" name="Static_properties">静的プロパティ</h2> <dl> <dt>{{jsxref("TypedArray.BYTES_PER_ELEMENT", "BigInt64Array.BYTES_PER_ELEMENT")}}</dt> <dd>要素サイズの数値を返します。<code>BigInt64Array</code> は <code>8</code> です。</dd> <dt>{{jsxref("TypedArray.name", "BigInt64Array.name")}}</dt> <dd>コンストラクター名の文字列を返します。<code>BigInt64Array</code> は "BigInt64Array" です。</dd> </dl> <h2 id="Static_methods" name="Static_methods">静的メソッド</h2> <dl> <dt>{{jsxref("TypedArray.from", "BigInt64Array.from()")}}</dt> <dd>array-like、あるいは iterable オブジェクトから新しい <code>BigInt64Array</code> を作成します。{{jsxref("Array.from()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.of", "BigInt64Array.of()")}}</dt> <dd>可変数の引数から新しい <code>BigInt64Array</code> を作成します。{{jsxref("Array.of()")}} も参照してください。</dd> </dl> <h2 id="Instance_properties" name="Instance_properties">インスタンスプロパティ</h2> <dl> <dt>{{jsxref("TypedArray.prototype.buffer", "BigInt64Array.prototype.buffer")}}</dt> <dd><code>BigInt64Array</code> が参照する {{jsxref("ArrayBuffer")}} を返します。これは構築時に固定されているため、<strong>読み取り専用</strong>です。</dd> <dt>{{jsxref("TypedArray.prototype.byteLength", "BigInt64Array.prototype.byteLength")}}</dt> <dd><code>BigInt64Array</code> の {{jsxref("ArrayBuffer")}} の先頭からの長さをバイト数で返します。これは構築時に固定されているため、<strong>読み取り専用</strong>です。</dd> <dt>{{jsxref("TypedArray.prototype.byteOffset", "BigInt64Array.prototype.byteOffset")}}</dt> <dd><code>BigInt64Array</code> の {{jsxref("ArrayBuffer")}} の先頭からのオフセットをバイト単位で返します。これは構築時に固定されているため、<strong>読み取り専用</strong>です。</dd> <dt>{{jsxref("TypedArray.prototype.length", "BigInt64Array.prototype.length")}}</dt> <dd><code>BigInt64Array</code> に保持されている要素数を返します。これは構築時に固定されているため、<strong>読み取り専用</strong>です。</dd> </dl> <h2 id="Instance_methods" name="Instance_methods">インスタンスメソッド</h2> <dl> <dt>{{jsxref("TypedArray.copyWithin", "BigInt64Array.prototype.copyWithin()")}}</dt> <dd>配列内の配列要素のシーケンスをコピーします。{{jsxref("Array.prototype.copyWithin()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.entries", "BigInt64Array.prototype.entries()")}}</dt> <dd>配列の各インデックスのキーと値のペアを含む、新しい <code>Array Iterator</code> オブジェクトを返します。{{jsxref("Array.prototype.entries()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.every", "BigInt64Array.prototype.every()")}}</dt> <dd>配列のすべての要素が、関数で指定されたテストに合格するかどうかをテストします。{{jsxref("Array.prototype.every()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.fill", "BigInt64Array.prototype.fill()")}}</dt> <dd>開始インデックスから終了インデックスまでの、配列のすべての要素を静的な値で埋めます。{{jsxref("Array.prototype.fill()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.filter", "BigInt64Array.prototype.filter()")}}</dt> <dd>指定したフィルターリング関数が <code>true</code> を返す要素をすべて含む、新しい配列を作成します。{{jsxref("Array.prototype.filter()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.find", "BigInt64Array.prototype.find()")}}</dt> <dd>配列内の要素が指定したテスト関数を満たしている場合は、配列内で見つかった値を返し、見つからなかった場合は <code>undefined</code> を返します。{{jsxref("Array.prototype.find()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.findIndex", "BigInt64Array.prototype.findIndex()")}}</dt> <dd>配列内の要素が指定したテスト関数を満たす場合は、配列内で見つかったインデックスを返し、見つからなかった場合は -1 を返します。{{jsxref("Array.prototype.findIndex()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.forEach", "BigInt64Array.prototype.forEach()")}}</dt> <dd>配列の各要素に対して関数を呼び出します。{{jsxref("Array.prototype.forEach()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.includes", "BigInt64Array.prototype.includes()")}}</dt> <dd>型付き配列が特定の要素を含むかどうかを判断し、適切な場合は <code>true</code> または <code>false</code> を返します。{{jsxref("Array.prototype.includes()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.indexOf", "BigInt64Array.prototype.indexOf()")}}</dt> <dd>指定した値と等しい配列内の要素の最初の(最小の)インデックスを返します。何も見つからない場合は -1 を返します。{{jsxref("Array.prototype.indexOf()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.join", "BigInt64Array.prototype.join()")}}</dt> <dd>配列のすべての要素を文字列に結合します。{{jsxref("Array.prototype.join()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.keys", "BigInt64Array.prototype.keys()")}}</dt> <dd>配列の各インデックスのキーを含む新しい <code>Array Iterator</code> を返します。{{jsxref("Array.prototype.keys()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.lastIndexOf", "BigInt64Array.prototype.lastIndexOf()")}}</dt> <dd>指定した値と等しい配列内の要素の最後の(最大の)インデックスを返します。何も見つからない場合は -1 を返します。{{jsxref("Array.prototype.lastIndexOf()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.map", "BigInt64Array.prototype.map()")}}</dt> <dd>この配列の各要素に対して指定した関数を呼び出した結果を持つ、新しい配列を作成します。{{jsxref("Array.prototype.map()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.reduce", "BigInt64Array.prototype.reduce()")}}</dt> <dd>アキュムレータと配列の各値(左から右へ)を一つの値に減らすための関数を適用します。{{jsxref("Array.prototype.reduce()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.reduceRight", "BigInt64Array.prototype.reduceRight()")}}</dt> <dd>アキュムレータと配列の各値(右から左へ)を一つの値に減らすための関数を適用します。{{jsxref("Array.prototype.reduceRight()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.reverse", "BigInt64Array.prototype.reverse()")}}</dt> <dd>配列の要素の順序を反転させます — 最初が最後になり、最後が最初になります。{{jsxref("Array.prototype.reverse()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.set", "BigInt64Array.prototype.set()")}}</dt> <dd>型付けされた配列に複数の値を格納し、指定した配列から入力値を読み込みます。</dd> <dt>{{jsxref("TypedArray.slice", "BigInt64Array.prototype.slice()")}}</dt> <dd>配列の一部を抽出し、新しい配列を返します。{{jsxref("Array.prototype.slice()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.some", "BigInt64Array.prototype.some()")}}</dt> <dd>配列の少なくとも一つの要素が、指定したテスト関数を満たしている場合に <code>true</code> を返します。{{jsxref("Array.prototype.some()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.sort", "BigInt64Array.prototype.sort()")}}</dt> <dd>配列の要素を所定の位置に並べ替えて、その配列を返します。{{jsxref("Array.prototype.sort()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.subarray", "BigInt64Array.prototype.subarray()")}}</dt> <dd>指定した開始要素と終了要素のインデックスから、新しい <code>BigUint64Array</code> を返します。</dd> <dt>{{jsxref("TypedArray.values", "BigInt64Array.prototype.values()")}}</dt> <dd>配列の各インデックスの値を含む、新しい <code>Array Iterator</code> オブジェクトを返します。{{jsxref("Array.prototype.values()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.toLocaleString", "BigInt64Array.prototype.toLocaleString()")}}</dt> <dd>配列とその要素を表すローカライズされた文字列を返します。{{jsxref("Array.prototype.toLocaleString()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.toString", "BigInt64Array.prototype.toString()")}}</dt> <dd>配列とその要素を表す文字列を返します。{{jsxref("Array.prototype.toString()")}} も参照してください。</dd> <dt>{{jsxref("TypedArray.@@iterator", "BigInt64Array.prototype[@@iterator]()")}}</dt> <dd>配列の各インデックスの値を含む、新しい <code>Array Iterator</code> オブジェクトを返します。</dd> </dl> <h2 id="Examples" name="Examples">例</h2> <h3 id="Different_ways_to_create_a_BigInt64Array" name="Different_ways_to_create_a_BigInt64Array"><code>BigInt64Array</code> の作成方法の違い</h3> <pre class="brush: js notranslate">// 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] </pre> <h2 id="Specifications" name="Specifications">仕様</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> </tr> </thead> <tbody> <tr> <td>{{SpecName("ESDraft", "#sec-typedarray-objects", "BigInt64Array")}}</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <p>{{Compat("javascript.builtins.BigInt64Array")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li><a href="/docs/Web/JavaScript/Typed_arrays" title="en/JavaScript typed arrays">JavaScript typed arrays</a></li> <li>{{jsxref("BigUint64Array")}}</li> <li>{{jsxref("DataView")}}</li> </ul>