The Javascript DataView setBigUint64() method stores an unsigned 64-bit integer value at the offset to the DataView.
dataview.setBigUint64(byteOffset, value [, littleEndian])
byteOffset
- the offset, in bytes, from the start of the view.value
- the value to set as a BigInt. littleEndian
- Optional, boolean value. If false or undefined, a big-endian value is written. Otherwise use the little endian.Using the setBigUint64 method
var buffer = new ArrayBuffer(8); var dataview = new DataView(buffer); dataview.setBigUint64(0, 3n);/* w w w. ja v a 2 s.c om*/ let a = dataview.getBigUint64(0); console.log(a);