Skip to main content
types.isAsyncFunction - node__util.d.ts - Node documentation
function types.isAsyncFunction

Usage in Deno

```typescript import { types } from "node:node__util.d.ts"; ```
isAsyncFunction(object: unknown): boolean
Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used. ```js util.types.isAsyncFunction(function foo() {}); // Returns false util.types.isAsyncFunction(async function foo() {}); // Returns true ```

Parameters

object: unknown

Return Type

boolean