diff options
Diffstat (limited to 'files/ja/web/javascript/reference/global_objects/bigint64array')
-rw-r--r-- | files/ja/web/javascript/reference/global_objects/bigint64array/index.html | 170 | ||||
-rw-r--r-- | files/ja/web/javascript/reference/global_objects/bigint64array/index.md | 147 |
2 files changed, 147 insertions, 170 deletions
diff --git a/files/ja/web/javascript/reference/global_objects/bigint64array/index.html b/files/ja/web/javascript/reference/global_objects/bigint64array/index.html deleted file mode 100644 index db7a3ac87f..0000000000 --- a/files/ja/web/javascript/reference/global_objects/bigint64array/index.html +++ /dev/null @@ -1,170 +0,0 @@ ---- -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> diff --git a/files/ja/web/javascript/reference/global_objects/bigint64array/index.md b/files/ja/web/javascript/reference/global_objects/bigint64array/index.md new file mode 100644 index 0000000000..b874e53d62 --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/bigint64array/index.md @@ -0,0 +1,147 @@ +--- +title: BigInt64Array +slug: Web/JavaScript/Reference/Global_Objects/BigInt64Array +tags: + - BigInt + - BigInt64Array + - クラス + - JavaScript + - Reference + - TypedArray + - 型付き配列 +browser-compat: javascript.builtins.BigInt64Array +translation_of: Web/JavaScript/Reference/Global_Objects/BigInt64Array +--- +{{JSRef}} + +**`BigInt64Array`** は型付き配列で、プラットフォームのバイト順による 16 ビット符号付き整数値の配列を表します。バイト順の制御が必要な場合は、代わりに {{jsxref("DataView")}} を使用してください。中身は `0n` で初期化されます。生成されると、配列内の要素はそのオブジェクトのメソッドを使用するか、配列の標準的な添字の構文 (すなわち、ブラケット記法) を使用するかして参照することができます。 + +## コンストラクター + +- [`BigInt64Array()`](/ja/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array) + - : 新しい `BigInt64Array` オブジェクトを生成します。 + +## 静的プロパティ + +- {{jsxref("TypedArray.BYTES_PER_ELEMENT", "BigInt64Array.BYTES_PER_ELEMENT")}} + - : 要素の大きさを数値で返します。`BigInt64Array` の場合は `8` です。 +- {{jsxref("TypedArray.name", "BigInt64Array.name")}} + - : コンストラクター名を文字列値で返します。`BigInt64Array` の場合、 "`BigInt64Array`" です。 + +## 静的メソッド + +- {{jsxref("TypedArray.from", "BigInt64Array.from()")}} + - : 配列風オブジェクトまたは反復可能オブジェクトから新しい `BigInt64Array` オブジェクトを生成します。 {{jsxref("Array.from()")}} も参照してください。 +- {{jsxref("TypedArray.of", "BigInt64Array.of()")}} + - : 可変長引数で新しい `BigInt64Array` オブジェクトを生成します。{{jsxref("Array.of()")}} も参照してください。 + +## インスタンスプロパティ + +- {{jsxref("TypedArray.prototype.buffer", "BigInt64Array.prototype.buffer")}} + - : `BigInt64Array` オブジェクトによって参照される {{jsxref("ArrayBuffer")}} を返します。構築時に固定され、**読み取り専用**です。 +- {{jsxref("TypedArray.prototype.byteLength", "BigInt64Array.prototype.byteLength")}} + - : {{jsxref("ArrayBuffer")}} の先頭からの `BigInt64Array` の長さを (バイト単位で) 返します。構築時に固定され、**読み取り専用**です。 +- {{jsxref("TypedArray.prototype.byteOffset", "BigInt64Array.prototype.byteOffset")}} + - : {{jsxref("ArrayBuffer")}} の先頭からの `BigInt64Array` のオフセットを (バイト単位で) 返します。構築時に固定され、**読み取り専用**です。 +- {{jsxref("TypedArray.prototype.length", "BigInt64Array.prototype.length")}} + - : `BigInt64Array` オブジェクト内に保持されている要素の数を返します。構築時に固定され、**読み取り専用**です。 + +## インスタンスメソッド + +- {{jsxref("TypedArray.copyWithin", "BigInt64Array.prototype.copyWithin()")}} + - : 配列内で一連の配列要素をコピーします。{{jsxref("Array.prototype.copyWithin()")}} も参照してください。 +- {{jsxref("TypedArray.entries", "BigInt64Array.prototype.entries()")}} + - : 配列内ですべての位置におけるキーと値の組を提供する新しい*配列イテレーター*を返します。{{jsxref("Array.prototype.entries()")}} も参照してください。 +- {{jsxref("TypedArray.every", "BigInt64Array.prototype.every()")}} + - : 配列内のすべての要素が関数によって提供されたテストに合格するかどうかテストを実行します。{{jsxref("Array.prototype.every()")}} も参照してください。 +- {{jsxref("TypedArray.fill", "BigInt64Array.prototype.fill()")}} + - : 配列の先頭位置から末尾位置までのすべての要素を固定値に設定します。{{jsxref("Array.prototype.fill()")}} も参照してください。 +- {{jsxref("TypedArray.filter", "BigInt64Array.prototype.filter()")}} + - : この配列のすべての要素のうち、与えられたフィルタリング関数が `true` を返すものをもつ新しい配列を生成します。{{jsxref("Array.prototype.filter()")}} も参照してください。 +- {{jsxref("TypedArray.find", "BigInt64Array.prototype.find()")}} + - : 配列内の要素に与えられたテスト関数を満足するものがあったら、見つかった値を返します。見つからなければ `undefined` を返します。{{jsxref("Array.prototype.find()")}} も参照してください。 +- {{jsxref("TypedArray.findIndex", "BigInt64Array.prototype.findIndex()")}} + - : 配列内の要素に与えられたテスト関数を満足するものがあったら、見つかった位置を返します。見つからなければ `-1` を返します。{{jsxref("Array.prototype.findIndex()")}} も参照してください。 +- {{jsxref("TypedArray.forEach", "BigInt64Array.prototype.forEach()")}} + - : 配列内のそれぞれの要素について関数を呼び出します。{{jsxref("Array.prototype.forEach()")}} も参照してください。 +- {{jsxref("TypedArray.includes", "BigInt64Array.prototype.includes()")}} + - : 型付き配列に特定の要素があるかどうかを判断し、それに応じて `true` か `false`を返します。 {{jsxref("Array.prototype.includes()")}} も参照してください。 +- {{jsxref("TypedArray.indexOf", "BigInt64Array.prototype.indexOf()")}} + - : 指定された値に等しい配列内の要素の最初の (最小の) 位置を返します。見つからなかった場合、 `-1` を返します。{{jsxref("Array.prototype.indexOf()")}} も参照してください。 +- {{jsxref("TypedArray.join", "BigInt64Array.prototype.join()")}} + - : 配列のすべての要素を 1 つの文字列に結合します。{{jsxref("Array.prototype.join()")}} も参照してください。 +- {{jsxref("TypedArray.keys", "BigInt64Array.prototype.keys()")}} + - : 配列内ですべての位置におけるキーを提供する新しい*配列イテレーター*を返します。{{jsxref("Array.prototype.keys()")}} も参照してください。 +- {{jsxref("TypedArray.lastIndexOf", "BigInt64Array.prototype.lastIndexOf()")}} + - : 指定された値に等しい配列内の要素の最後の (最大の) 位置を返します。見つからなかった場合、 `-1` を返します。{{jsxref("Array.prototype.lastIndexOf()")}} も参照してください。 +- {{jsxref("TypedArray.map", "BigInt64Array.prototype.map()")}} + - : この配列のすべての要素で与えられた関数を呼び出した結果をもつ新しい配列を生成します。{{jsxref("Array.prototype.map()")}} も参照してください。 +- {{jsxref("TypedArray.reduce", "BigInt64Array.prototype.reduce()")}} + - : アキュムレーターとこの配列のそれぞれの値に対して (左から右へ) 関数を適用し、単一の値に還元します。{{jsxref("Array.prototype.reduce()")}} も参照してください。 +- {{jsxref("TypedArray.reduceRight", "BigInt64Array.prototype.reduceRight()")}} + - : アキュムレーターとこの配列のそれぞれの値に対して (右から左へ) 関数を適用し、単一の値に還元します。{{jsxref("Array.prototype.reduceRight()")}} も参照してください。 +- {{jsxref("TypedArray.reverse", "BigInt64Array.prototype.reverse()")}} + - : 配列の要素の順番を反転させます。最初の要素は最後になり、最後の要素は最初になります。{{jsxref("Array.prototype.reverse()")}} も参照してください。 +- {{jsxref("TypedArray.set", "BigInt64Array.prototype.set()")}} + - : 入力値を指定した配列から読み込み、この型付き配列内に複数の値を格納します。 +- {{jsxref("TypedArray.slice", "BigInt64Array.prototype.slice()")}} + - : 配列の一部を取り出して新しい配列を返します。{{jsxref("Array.prototype.slice()")}} も参照してください。 +- {{jsxref("TypedArray.some", "BigInt64Array.prototype.some()")}} + - : この配列の 1 つ以上の要素が与えられたテスト関数を満たした場合に `true` を返します。{{jsxref("Array.prototype.some()")}} も参照してください。 +- {{jsxref("TypedArray.sort", "BigInt64Array.prototype.sort()")}} + - : 配列の要素をその場で並べ替え、その配列を返します。{{jsxref("Array.prototype.sort()")}} も参照してください。 +- {{jsxref("TypedArray.subarray", "BigInt64Array.prototype.subarray()")}} + - : 指定された先頭と末尾の要素位置から新しい `BigInt64Array` を返します。 +- {{jsxref("TypedArray.values", "BigInt64Array.prototype.values()")}} + - : 配列内ですべての位置における値を提供する新しい*配列イテレーター*を返します。{{jsxref("Array.prototype.values()")}} も参照してください。 +- {{jsxref("TypedArray.toLocaleString", "BigInt64Array.prototype.toLocaleString()")}} + - : 配列とその要素を表すローカライズされた文字列を返します。{{jsxref("Array.prototype.toLocaleString()")}} も参照してください。 +- {{jsxref("TypedArray.toString", "BigInt64Array.prototype.toString()")}} + - : 配列とその要素を表す文字列を返します。{{jsxref("Array.prototype.toString()")}} も参照してください。 +- {{jsxref("TypedArray.@@iterator", "BigInt64Array.prototype[@@iterator]()")}} + - : 配列内ですべての位置における値を提供する新しい*配列イテレーター*を返します。 + +## 例 + +### 様々な方法で `BigInt64Array` を作成 + +```js +// 長さから +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 + +// From another 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); + +// 反復可能オブジェクトから +var iterable = function*(){ yield* [1n, 2n, 3n]; }(); +var bigint64 = new BigInt64Array(iterable); +// BigInt64Array[1n, 2n, 3n] +``` + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} + +## 関連情報 + +- [JavaScript の型付き配列](/ja/docs/Web/JavaScript/Typed_arrays) +- {{jsxref("BigUint64Array")}} +- {{jsxref("DataView")}} |