📜  检查 javascript 对象不是数组且不是 null - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:04.099000             🧑  作者: Mango

代码示例3
In javascript an array is also an object, 
so most of the time you want to exclude the array: 

function isObjectExcludeArray(obj){
    return (obj === Object(obj) && Object.prototype.toString.call(obj) !== '[object Array]');
}