Standard built-ins
DataView.prototype.setBigInt64()
Writes a signed 64-bit BigInt at an arbitrary byte offset. The entire value must fit in the view; otherwise a RangeError is thrown.
Formal Syntax & Structure
javascript syntaxjavascript
view.setBigInt64(byteOffset, value, littleEndian?)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| byteOffset | number | Starting byte offset within the view. |
| value | bigint | Value to encode as a signed 64-bit BigInt. |
| littleEndian | boolean | True for little-endian; omitted or false means big-endian. |
Return Value
undefined
Changes the bytes in the backing buffer.
Working Example
Example Snippetjavascript
const view=new DataView(new ArrayBuffer(9)); const result=view.setBigInt64(1,-9007199254740993n,true); console.log(String(result),String(view.getBigInt64(1,true)));