Node.js util.types.isFloat64Array() Method
Last Updated :
07 Mar, 2024
The util.types.isFloat64Array() method is an inbuilt application programming interface of the util module which is used to check for Float64Array type in the node.js.
Syntax:
util.types.isFloat64Array( value )
Parameters: This method accepts a single parameter as mentioned above and described below:
- value: It is a required parameter that holds any data type.
Return Value: It returns a boolean value, TRUE if the value is a Float64Array, FALSE otherwise.
Example 1: In the below example illustrates the use of util.types.isFloat64Array() method in Node.js:
javascript
const util = require( 'util' );
let v1 = new BigInt64Array();
let v2 = new BigUint64Array();
let v3 = new Float32Array();
let v4 = new ArrayBuffer();
let v5 = new Float64Array();
console.log(util.types.isFloat64Array(v1));
console.log(util.types.isFloat64Array(v2));
console.log(util.types.isFloat64Array(v3));
console.log(util.types.isFloat64Array(v4));
console.log(util.types.isFloat64Array(v5));
|
Output:
false
false
false
false
true
Example 2: In this example, we will illustrate the use of util.types.isFloat64Array() method in Node.js:
javascript
const util = require( 'util' );
let v1 = new Float64Array();
let v2 = new Float64Array();
if (util.types.isFloat64Array(v1))
console.log( "The passed value is a Float64Array." );
else
console.log( "The passed value is not a Float64Array" );
if (util.types.isFloat64Array(v2))
console.log( "The passed value is a Float64Array." );
else
console.log( "The passed value is not a Float64Array" );
|
Output:
The passed value is not a Float64Array
The passed value is a Float64Array.
Note: The above program will compile and run by using the node filename.js command.
Share your thoughts in the comments
Please Login to comment...