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

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


posted @ 2020-04-25 22:38  xgqfrms  阅读(158)  评论(9编辑  收藏  举报