xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

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


原文地址:https://www.cnblogs.com/xgqfrms/p/12775865.html