Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

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

  • Last Updated : 27 Apr, 2020

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:




// 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 BigUint64Array();
  
// 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:




// 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 BigUint64Array();
  
// 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
Recommended Articles
Page :