Open In App

JavaScript dataView.getBigInt64() method

This getBigInt64() method is used to get a signed 64-bit integer (long long) at the particular byte offset from the start of the DataView.

Syntax:



dataview.getBigInt64(byteOffset, value, littleEndian)

Parameters:

Return Value: It returns a BigInt value.



Thrown Error: If the byteOffset is passed beyond the end of the view then the RangeError is thrown.

Below are examples of the dataView.setInt8() Method.

Example 1: 




var buffr = new ArrayBuffer(12); 
 
var dataview = new DataView(buffr);  
console.log(dataview.getBigInt64(0));

Output:

0

Example 2: In this example, the offset passed is 0, so the value printed is 0 because nothing is set.




// Creating buffer with size in byte
var buffr = new ArrayBuffer(8);
 
// Creating a view
var dataview = new DataView(buffr); 
console.log(dataview.getBigInt64(0));

Output:

0

Example 3: In this example, the offset passed is 3, so the value printed is 10000 because it is set before.




// create an ArrayBuffer with a size in bytes
const buffr = new ArrayBuffer(16);
// constant value to set
const max = 10000n;
const view = new DataView(buffr);
view.setBigInt64(3, max);
console.log(view.getBigInt64(3));

Output:

10000

We have a complete list of Javascript Date Objects, to check those please go through this JavaScript dataView Complete Reference article.

Supported Browsers: 

We have a Cheat Sheet on Javascript where we covered all the important topics of Javascript to check those please go through Javascript Cheat Sheet-A Basic guide to JavaScript.  


Article Tags :