new的作用就是省了几行代码,所谓的语法糖。很贴心的语法。 var object = new Object()
new了以后,做了什么? 加了自由属性 空 object.proto === Object.prototype 这两个proto,一个是对象自己有的,一个是js之父指定的。
var array = new Array('a','b','c') 自有属性 0:'a' 1:'b' 2:'c' array.proto === Array.prototype
(原型就是共有属性)
new的作用就是省了 var temp={} this = temp this.proto = create士兵。prototype return this 这四句话。