Skip to content
Subhajit Sahu edited this page Jul 29, 2022 · 3 revisions

Check if value is a function.

Similar: is, isAsync, isGenerator.


function is(v)
// v: a value
const xfunction = require('extra-function');


xfunction.is(Object.keys);
// → true

xfunction.is(() => 0);
// → true

xfunction.is(async () => 0);
// → true

xfunction.is(0);
// → false


References