笼统校验是否为对象
const isObject = function isObject(obj) {
return obj !== null && /^(object|function)$/.test(typeof obj)
}
检测是否为函数
const isFunction = function isFunction(obj) {
return typeof obj === 'function'
}
检测是否为window
const isWindow = function isWindow(obj) {
return obj != null && obj === obj.window
}