var isFunction = function isFunction( obj ) {
// Support: Chrome <=57, Firefox <=52
// In some browsers, typeof returns "function" for HTML <object> elements
// (i.e., `typeof document.createElement( "object" ) === "function"`).
// We don't want to classify *any* DOM node as a function.
return typeof obj === "function" && typeof obj.nodeType !== "number";
};
为什么要写这句typeof obj.nodeType !== "number";
是兼容ie吗
有些浏览器把dom节点的类型是function,因此我们要排除这种情况。凡是nodeType是数字类型都是节点。因此nodeType不是数值类型即排除dom节点