new 一共做了四件事
1.創(chuàng)建臨時對象
2.為臨時對象綁定原型
3.執(zhí)行構(gòu)造函數(shù)的代碼(為這個對象添加屬性)
4.返回新對象
var object = new Object()
自有屬性空
object.proto === Object.prototype
var array = new Array('a','b','c')
自有屬性 0:'a' 1:'b' 2:'c' length: 2
array.proto === Array.prototype
Array.prototype.proto = Object.prototype
var fn = new Function('x','y','return x+y')
自有屬性:length:2 , 不可見的函數(shù)體:'return x + y'
fn.proto === Function.prototype
Array is a function
Array = function(){...}
Array.proto = Function.prototype