JS: Determine Type of Object
How to find out if a object is function, array, date, regex, etc?
Check If Object is Array
Check If Object is Function
typeof obj === "function"
(also works on Arrow Function)
Other
The most reliable and generic way to determine the type of object is this:
Reflect.apply( Object.prototype.toString , val, [] )
For detail, see Object.prototype.toString
JavaScript, Value Types
JavaScript, Object and Inheritance
- JS: Object Tutorial
- JS: Object Overview
- JS: Object Type
- JS: Test is Object Type π
- JS: Determine Type of Object
- JS: Prototype and Inheritance
- JS: Prototype Chain
- JS: Object.prototype.isPrototypeOf
- JS: Get Set Prototype
- JS: Show Prototype Chain π
- JS: Create Object
- JS: Object Literal Expression
- JS: Create Object with Parent X
- JS: Prevent Adding Property
- JS: Deep Copy Array or Object π
- JS: Test Equality of Array and Object by Content π
- JS: Add Method to Prototype
- JS: Object Object
- JS: Object Constructor
- JS: Object.prototype