Skip to main content

isObject() function

Determines whether a value is a non-array object.

Signature​

export declare function isObject(value: unknown): boolean;

Parameters​

Parameter

Type

Description

value

unknown

The value to test.

Returns​

boolean

true if the value is a non-array object, false otherwise.

Remarks​

This function distinguishes between objects and arrays, which is crucial when processing JSON structures where both use the object type but require different handling.

Returns true for: plain objects, class instances, null and other object types.

Returns false for: arrays, primitives, and functions.

Note: Arrays in JavaScript are objects, so this function explicitly excludes them using Array.isArray(). Use isJsonObject() for stricter JSON object validation that also excludes undefined and null.


Generated via tsdoc2docusaurus 1.3.2 by API Extractor/Documenter 7.57.2.