The angular.isObject
return true if and only if the argument passed to it is an object, this function will also return true for an Array and will return false for null
even though typeof null
is object
.
angular.isObject(value)
This function is useful for type checking when you need a defined object to process.
Examples:
angular.isObject({name: "skroob", job: "president"})
// true
angular.isObject(null)
// false
angular.isObject([null])
// true
angular.isObject(new Date())
// true
angular.isObject(undefined)
// false