isFunction

external fun isFunction(value: Any?): Boolean(source)

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

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

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

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

Since

v0.11.5