[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/DataView/setBigInt64 [Back]  [Original]

DataView.prototype.setBigInt64() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

DataView.prototype.setBigInt64()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2021 9.

DataView setBigInt64() BigInt DataView 8 64 . , .

In this article

// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);

// Highest possible BigInt value that fits in a signed 64-bit integer
const max = 2n ** (64n - 1n) - 1n;

const view = new DataView(buffer);
view.setBigInt64(1, max);

console.log(view.getBigInt64(1));
// Expected output: 9223372036854775807n

js
setBigInt64(byteOffset, value)
setBigInt64(byteOffset, value, littleEndian)

byteOffset

.

value

BigInt . .

littleEndian Optional

. false undefined .

undefined.

RangeError

byteOffset .

setBigInt64()

js
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setBigInt64(0, 3n);
dataview.getBigInt64(1); // 768n

Specification
ECMAScript 2027 LanguageSpecification
# sec-dataview.prototype.setbigint64


Web Proxy Viewer  |  New URL  |  Original Page