Object.is
Object.is
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
func = function () {}
// ƒ () {}
obj = {}
// {}
Function
// ƒ Function() { [native code] }
Object
// ƒ Object() { [native code] }
Function == Object;
// false
func instanceof Function
// true
func instanceof Object
// true
typeof func
// "function"
obj instanceof Object
// true
obj instanceof Function
// false
typeof obj
// "object"
Object.is(obj, func)
// false
Object.is(func, Function)
// false
Object.is(obj, Object)
// false
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/12775865.html
未经授权禁止转载,违者必究!