new 的应用

function Student(name) {  this.name = name}var stu = new Student('tao')

new 的原理

function Student(name) {  // js 会创立长期对象保留 stu 的属性  // var temp = {}  // 扭转 this 指向  // this = temp  // 扭转原型  // this.__proto__ = Student.prototype  this.name = name  // 而后返回 这个 stu  // return this}