| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array | [Back] [Original] |
Get to know MDN better
Cette page a t traduite partir de l'anglais par la communaut. Vous pouvez contribuer en rejoignant la communaut francophone sur MDN Web Docs.
Cette fonctionnalit est bien tablie et fonctionne sur de nombreux appareils et versions de navigateurs. Elle est disponible sur tous les navigateurs depuis septembre 2021.
Le tableau typ BigInt64Array reprsente un tableau d'entiers signs sur 64 bits dans l'ordre d'octets de la plateforme. Si vous avez besoin de contrler l'ordre des octets, utilisez plutt DataView. Le contenu est initialis 0n sauf si des donnes d'initialisation sont fournies explicitement. Une fois cr, vous pouvez accder aux lments du tableau en utilisant les mthodes de l'objet ou la syntaxe d'indice standard (c'estdire la notation entre crochets).
BigInt64Array est une sous-classe de la classe cache TypedArray.
const buffer = new ArrayBuffer(24);
const bigint64 = new BigInt64Array(buffer);
bigint64[0] = 5886014448488689n;
bigint64[1] = 1881938909131133n;
bigint64[2] = 1898875537769492n;
bigint64[0] = 6118793953620967n;
console.log(bigint64);
// Rsultat attendu : BigInt64Array [6118793953620967n, 1881938909131133n, 1898875537769492n]
console.log(bigint64[2]);
// Rsultat attendu : 1898875537769492n
console.log("Longueur de Array :", bigint64.length);
// Rsultat attendu : Longueur de Array : 3
console.log("Longueur en octets de Array :", bigint64.byteLength);
// Rsultat attendu : Longueur en octets de Array : 24
console.log("Dcalage en octets de Array :", bigint64.byteOffset);
// Rsultat attendu : Dcalage en octets de Array : 0
bigint64.set([100n, 200n], 1);
console.log(bigint64);
// Rsultat attendu : BigInt64Array [6118793953620967n, 100n, 200n]
BigInt64Array()Cre un nouvel objet BigInt64Array.
Hrite galement des proprits statiques de son parent TypedArray.
BigInt64Array.BYTES_PER_ELEMENTRetourne un nombre indiquant la taille d'un lment. 8 dans le cas de BigInt64Array.
Hrite des mthodes statiques de son parent TypedArray.
Hrite galement des proprits d'instance de son parent TypedArray.
Ces proprits sont dfinies sur BigInt64Array.prototype et sont partages par toutes les instances de BigInt64Array.
BigInt64Array.prototype.BYTES_PER_ELEMENTCette proprit retourne un nombre correspondant la quantit d'octets pour un lment du tableau. 8 dans le cas d'un BigInt64Array.
BigInt64Array.prototype.constructorLa fonction constructeur qui a cr l'objet instance. Pour les instances de BigInt64Array, la valeur initiale est le constructeur BigInt64Array.
Hrite des mthodes d'instance de son parent TypedArray.
BigInt64Array// Construction partir d'une longueur
const bigint64 = new BigInt64Array(2);
bigint64[0] = 42n;
console.log(bigint64[0]); // 42n
console.log(bigint64.length); // 2
console.log(bigint64.BYTES_PER_ELEMENT); // 8
// Construction partir d'un tableau
const x = new BigInt64Array([21n, 31n]);
console.log(x[1]); // 31n
// Construction partir d'un tableau typ
const y = new BigInt64Array(x);
console.log(y[0]); // 21n
// Construction partir d'un ArrayBuffer
const buffer = new ArrayBuffer(64);
const z = new BigInt64Array(buffer, 8, 4);
console.log(z.byteOffset); // 8
// Construction partir d'un itrable
const iterable = (function* () {
yield* [1n, 2n, 3n];
})();
const bigint64FromIterable = new BigInt64Array(iterable);
console.log(bigint64FromIterable);
// BigInt64Array[1n, 2n, 3n]
| Spcification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-typedarray-objects |
TypedArrayArrayBufferDataViewCette page a t modifie le 1 sept. 2026 par les contributeurices du MDN.
BigInt64ArrayTypedArrayTypedArray.prototype.at()TypedArray.prototype.copyWithin()TypedArray.prototype.entries()TypedArray.prototype.every()TypedArray.prototype.fill()TypedArray.prototype.filter()TypedArray.prototype.find()TypedArray.prototype.findIndex()findLast()findLastIndex()TypedArray.prototype.forEach()TypedArray.prototype.includes()TypedArray.prototype.indexOf()TypedArray.prototype.join()TypedArray.prototype.keys()TypedArray.prototype.lastIndexOf()TypedArray.prototype.map()TypedArray.prototype.reduce()TypedArray.prototype.reduceRight()TypedArray.prototype.reverse()TypedArray.prototype.set()TypedArray.prototype.slice()TypedArray.prototype.some()TypedArray.prototype.sort()TypedArray.prototype.subarray()TypedArray.prototype.toLocaleString()toReversed()toSorted()TypedArray.prototype.toString()TypedArray.prototype.values()with()TypedArray.prototype[@@iterator]()Object/FunctionBigUint64ArrayFloat16ArrayFloat32ArrayFloat64ArrayInt8ArrayInt16ArrayInt32ArrayUint8ArrayUint8ClampedArrayUint16ArrayUint32ArrayCertaines parties de ce contenu sont protges par le droit d'auteur 19982026 des contributeurs individuels de mozilla.org. Contenu disponible sous une licence Creative Commons.
| Web Proxy Viewer | New URL | Original Page |