Skip to content

@technobuddha > library > Object > Type Guards

Function: isObject()

ts
function isObject(value: unknown): value is object;

Defined in: is-object.ts:16

Determines whether the provided value is a non-null object.

Parameters

ParameterTypeDescription
valueunknownThe value to check.

Returns

value is object

true if the value is an object and not null; otherwise, false.

Example

typescript
isObject({}); // true
isObject([]); // true
isObject(null); // false
isObject(42); // false
isObject('hello'); // false