Skip to main content

isObj

Checks if a value is an object (but not null).

Import

You can import the entire package and access the function:


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

Or import directly the specific function:


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

Usage


_10
import { isObj } from "@onflow/sdk"
_10
_10
console.log(isObj({})); // true
_10
console.log(isObj({name: "Alice"})); // true
_10
console.log(isObj(null)); // false
_10
console.log(isObj("string")); // false
_10
console.log(isObj([])); // true (arrays are objects)

Parameters

d

  • Type: any
  • Description: The value to check

Returns

boolean


Rate this page