Skip to content

Latest commit

 

History

History
22 lines (19 loc) · 434 Bytes

is-object.md

File metadata and controls

22 lines (19 loc) · 434 Bytes

isObject

/*
isObject(val: unknown): boolean
*/

/**
 * Checks that a value has a type "object" and is not null
 * Uses "typeof val === 'object' && val !== null" comparison
 *
 * To check if an object is plain use "isPlainObject" function
 */

// Examples
isObject({});// true
isObject(new Object());// true
isObject(Object.create(null));// true
isObject(new Date());// true
isObject([]);// true
isObject(null);// false