1In javascript an array is also an object,
2so most of the time you want to exclude the array:
3
4function isObjectExcludeArray(obj){
5 return (obj === Object(obj) && Object.prototype.toString.call(obj) !== '[object Array]');
6}
1function isObject(val) {
2 if (val === null) { return false;}
3 return ( (typeof val === 'function') || (typeof val === 'object') );
4}
5
1function isObject (item) {
2 return (typeof item === "object" && !Array.isArray(item) && item !== null && item!==undefined);
3}
4