Robin-front/robin-front.github.io

比较instanceof与isPrototypeOf | 知更鸟

Opened this issue · 0 comments

https://robin-front.github.io/2017/01/12/compare-instanceof-with-isPrototypeof.html

比较instanceof与isPrototypeOf在javascript中,instanceof 和 isPrototypeOf 都可以判断一个原型是否在另一个实例的原型链中,那他们有什么区别呢,为什么说 isPrototypeOf 可以替代 instanceof 。