isObject

function isObject(val): val is object

Returns true if the specified value is an object (including arrays and functions) (i.e. it's safe to do property accesses on it).

Parameters

ParameterTypeDescription
valunknownVariable to test.

Returns

val is object

Whether variable is an object.