标签:忘记 结果 构造器 基本 原理 height pre hold add
function Keith(){ this.height = 180; } var person = Keith(); console.log(person.height); //person is underfined
function Keith(){ this.height = 180; return{ height:200 }; } var boy = new Keith(); console.log(boy.height) //200 function Keith(){ this.height =100; return 200; } var boy = new Keith(); console.log(boy.height); //100
标签:忘记 结果 构造器 基本 原理 height pre hold add
原文地址:http://www.cnblogs.com/21haoxingxiu/p/7253463.html