Little function to check if a value is an object:
function isObject(val){
return (
val != null &&
typeof val === 'object' &&
Array.isArray(val) === false
);
}
Notice that Date, RegExp, etc.. will pass the check.
Little function to check if a value is an object:
function isObject(val){
return (
val != null &&
typeof val === 'object' &&
Array.isArray(val) === false
);
}
Notice that Date, RegExp, etc.. will pass the check.