Skip to content
Related Articles
Open in App
Not now

Related Articles

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

Improve Article
Save Article
Like Article
  • Last Updated : 05 Jan, 2023
Improve Article
Save Article
Like Article

The util.types.isBigInt64Array() method is an inbuilt application programming interface of the util module which is used to type check for BigInt64Array in the node.js. 

Syntax:

util.types.isBigInt64Array( value )

Parameters: This method accepts single parameter as mentioned above and described below:

  • value: It is a required parameter and of any datatype.

Return Value: It returns a boolean value i.e. TRUE if the value is a BigInt64Array, FALSE otherwise. 

Below examples illustrate the use of util.types.isBigInt64Array() method in Node.js: 

Example: 

javascript




// Node.js program to demonstrate the  
// util.types.isBigInt64Array() Method
 
// Allocating util module
const util = require('util');
 
// Functions to be passed as parameter
// of utiltypes.isBigInt64Array() method
var v1 = new BigInt64Array();
var v2 = new Bigint64Array();
 
// Printing the returned value from
// util.types.isBigInt64Array() method
console.log(util.types.isBigInt64Array(v1));
console.log(util.types.isBigInt64Array(v2));


Output:

true
false

Example: 

javascript




// Node.js program to demonstrate the  
// util.types.isBigInt64Array() Method
 
// Allocating util module
const util = require('util');
 
// Functions to be passed as parameter of
// utiltypes.isBigInt64Array() method
var v1 = new BigInt64Array();
var v2 = new Bigint64Array();
 
// Calling util.types.isBigInt64Array() method
if(util.types.isBigInt64Array(v1))
    console.log("The passed value is a BigInt64Array.");
else
    console.log("The passed value is not a BigInt64Array");
 
if(util.types.isBigInt64Array(v2))
    console.log("The passed value is a BigInt64Array.");
else
    console.log("The passed value is not a BigInt64Array");


Output:

The passed value is a BigInt64Array.
The passed value is not a BigInt64Array

Note: The above program will compile and run by using the node filename.js command. 

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


My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!