(接上)先看张对老手不新鲜但对菜鸟很有趣的图:
What the heck is that? 简直是luan lun。
new
抛开上面的图,先看看上篇文章留下的第二个问题,让我们在构造器的函数体内加点东西,看会发生什么。
var Function = new Function()var Object = new Function()
根据上篇文章的规律,会有Function.__proto__ === Function.prototype,以及Object.__proto__ === Function.prototype,验证一下:
Function instanceof Object,这是显然为true的,万物归Object管,Function的__proto__链依次指向:Function.prototype,Object.prototype。
Object instanceofFunction,因为Function.prototype在Object的__proto__链中,所以也为true。