Node.js | util.types.isBigInt64Array() Method
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.
The below examples illustrate the use of util.types.isBigInt64Array() method in Node.js:
Example 1:
javascript
const util = require( 'util' );
let v1 = new BigInt64Array();
let v2 = new Bigint64Array();
console.log(util.types.isBigInt64Array(v1));
console.log(util.types.isBigInt64Array(v2));
|
Output:
true
false
Example:
javascript
const util = require( 'util' );
let v1 = new BigInt64Array();
let v2 = new Bigint64Array();
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
Last Updated :
03 Apr, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...