Skip to main content

isFn

Checks if a value is a function.

Import

You can import the entire package and access the function:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.isFn(d)

Or import directly the specific function:


_10
import { isFn } from "@onflow/sdk"
_10
_10
isFn(d)

Usage


_10
import { isFn } from "@onflow/sdk"
_10
_10
console.log(isFn(() => {})); // true
_10
console.log(isFn(function() {})); // true
_10
console.log(isFn("function")); // false
_10
console.log(isFn({})); // false

Parameters

d

  • Type: any
  • Description: The value to check

Returns

boolean


Rate this page