Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Node.js util.types.isFloat64Array() Method

  • Last Updated : 08 Oct, 2021

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 single parameter as mentioned above and described below:

  • value: It is a required parameter that holds any datatype.

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

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

Example 1:




// Node.js program to demonstrate the   
// util.types.isFloat64Array() Method
  
// Allocating util module
const util = require('util');
  
// Passed as parameter to the
// util.types.isFloat64Array() method
var v1 = new BigInt64Array();
var v2 = new BigUint64Array();
var v3 = new Float32Array();
var v4 = new ArrayBuffer();
var v5 = new Float64Array();
  
// Printing the returned value from 
// util.types.isFloat64Array() method
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:




// Node.js program to demonstrate the   
// util.types.isFloat64Array() Method
  
// Allocating util module
const util = require('util');
  
// To be passed as parameter of 
// util.types.isFloat64Array() method
var v1 = new Float32Array();
var v2 = new Float64Array();
  
// Calling util.types.isFloat64Array() method
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.

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


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!