javascript new

1. 仅function可以使用new

2. function使用new时,会拷贝function中this的内容给新对象,并将function的prototype指向新对象(如果该function没有prototype,则指向Object的prototype)

注:function本身不是Object,所以function定义的内部变量不属于this

原文地址:https://www.cnblogs.com/kevinge/p/4031154.html