Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Node.js util.types.isBigUint64Array() Method

  • Last Updated : 12 Oct, 2021

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:




// 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);

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:




// 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);

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
Recommended Articles
Page :

Start Your Coding Journey Now!