isFunction - Node documentation
function isFunction

Usage in Deno

import { isFunction } from "node:util";
isFunction(object: unknown): boolean
Deprecated

Since v4.0.0 - Use typeof value === 'function' instead.

Returns true if the given object is a Function. Otherwise, returnsfalse.

const util = require('node:util');

function Foo() {}
const Bar = () => {};

util.isFunction({});
// Returns: false
util.isFunction(Foo);
// Returns: true
util.isFunction(Bar);
// Returns: true

Parameters

object: unknown

Return Type

boolean