Checks if the given value is an object.

Type signature

(x?: unknown) => boolean

Examples

object({ a: 1, b: 2 });
// ⇒ true
Try in REPL
object([1, 2, 3]);
// ⇒ false
Try in REPL

Questions

  • How to check if a given value is an object?

TypeScript sourceJavaScript source