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

Node.jsServer Side ProgrammingProgramming

The util.types.isBigInt64Array() method checks whether the passed value is a BigInt64Array instance or not. If the above condition is satisfied, it returns True, else False.

Syntax

util.types.isBigInt64Array(value)

Parameters

  • value − This input value takes input for the required parameter and checks if it's a BigInt64 array instance or not.

It returns True or False based upon the input value passed.

Example 1

Create a file named "isBigInt64Array.js" and copy the following code snippet. After creating the file, use the command "node isBigInt64Array.js" to run this code.

// util.types.isBigInt64Array() Demo Example

// Importing the util module
const util = require('util');

// Functions to be passed as parameter
// of utiltypes.isBigInt64Array() method
var arr = new BigInt64Array();

// Passing BigInt64 Array as input value
console.log(util.types.isBigInt64Array(arr));

Output

C:\home\node>> node isBigInt64Array.js
true

Example 2

// util.types.isBigInt64Array() Demo Example

// Importing the util module
const util = require('util');

// Functions to be passed as parameter
// of utiltypes.isBigInt64Array() method
var arr = new BigInt64Array();

// Passing BigInt64 Array as input value
console.log("1." + util.types.isBigInt64Array(arr));

// Passing BigInt64 Array prototype
console.log("2." + util.types.isBigInt64Array(BigInt64Array.prototype));

// Defining a typedArray
const typedArray = new Int8Array(8);
// Passing Typed array to check
console.log("3." + util.types.isBigInt64Array(typedArray));

Output

C:\home\node>> node isBigInt64Array.js
1. true
2. false
3. false
raja
Published on 17-Aug-2021 11:18:05
Advertisements