![]() |
VOOZH | about |
The util.types.isAsyncFunction() method is an inbuilt application programming interface of the util module which is used to type check for asynchronous functions in the node.js.
Syntax:
util.types.isAsyncFunction( value )
Parameters: This method accepts a single parameter as mentioned above and described below:
Return Value: It returns a boolean value, TRUE if the value is an async function from the perspective of the JavaScript engine, FALSE otherwise.
The below examples illustrate the use of util.types.isAsyncFunction() method in Node.js:
Example 1:
Output:
true false
Example 2:
Output:
The passed value is an Async function. The passed value is not an Async function
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_isasyncfunction_value