Node.js | util.types.isBigUint64Array() Method

The util.types.isBigUint64Array() method of util module is primarily designed to support the needs of Node.js own Internal APIs.

The util.types.isBigUint64Array() method is used to check if the given value is a BigUint64Array object.

Syntax:

util.types.isBigUint64Array( value )

Parameters: This function accepts one parameter as mentioned above and described below:

  • value: This is the value that would be checked for a BigUint64Array object.

Return Value: This method returns a Boolean value i.e true if the passed value is instance of BigUint64Array otherwise returns false.



Below examples illustrate the util.types.isBigUint64Array() method in Node.js:

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

// Node.js program to demonstrate the    
// util.types.isBigUint64Array() method
  
// Import the util module
const util = require('util');
  
// Checking for a big signed 64-bit integer array
isBigUnsignedint64Arr
  = util.types.isBigUint64Array(new BigUint64Array());
console.log("Object is Big Unsigned 64-bit array object:",
  isBigUnsignedint64Arr);
  
isBigUnsignedint64Arr
  = util.types.isBigUint64Array(new BigInt64Array());
console.log("Object is Big Unsigned 64-bit array object:",
  isBigUnsignedint64Arr);
  
isBigUnsignedint64Arr
  = util.types.isBigUint64Array(new Int32Array());
console.log("Object is Big Unsigned 64-bit array object:",
  isBigUnsignedint64Arr);

chevron_right


Output:

Object is Big Unsigned 64-bit array object: true
Object is Big Unsigned 64-bit array object: false
Object is Big Unsigned 64-bit array object: false

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

// Node.js program to demonstrate the    
// util.types.isBigUint64Array() method
  
// Import the util module
const util = require('util');
  
// Checking a big unsigned 64-bit integer array
let bigUnsigned64Arr
  = new BigUint64Array([16n, 25n, 69n]);
console.log(bigUnsigned64Arr);
  
isBigUnsignedint64Arr
  = util.types.isBigUint64Array(bigUnsigned64Arr);
console.log("Object is Big Unsigned 64-bit array object:",
  isBigUnsignedint64Arr);
  
// Checking a big signed 64-bit integer array
let bigSigned64Arr
  = new BigInt64Array([16n, 25n, 69n]);
console.log(bigSigned64Arr);
  
isBigUnsignedint64Arr
  = util.types.isBigUint64Array(bigSigned64Arr);
console.log("Object is Big Unsigned 64-bit array object:",
  isBigUnsignedint64Arr);
  
// Checking a unsigned 32-bit integer array
let unsigned32Arr
  = new Uint32Array([16, 25, 69]);
console.log(unsigned32Arr);
  
isBigUnsignedint64Arr
  = util.types.isBigUint64Array(unsigned32Arr);
console.log("Object is Big Unsigned 64-bit array object:",
  isBigUnsignedint64Arr);

chevron_right


Output:

BigUint64Array [ 16n, 25n, 69n ]
Object is Big Unsigned 64-bit array object: true
BigInt64Array [ 16n, 25n, 69n ]
Object is Big Unsigned 64-bit array object: false
Uint32Array [ 16, 25, 69 ]
Object is Big Unsigned 64-bit array object: false

Reference: https://nodejs.org/api/util.html#util_util_types_isbiguint64array_value




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.