摘要:
var a = new XXX();a是什么?要分类讨论一:function XXX(){ return 原始类型(数字,字符串,bool,null,undefined)}则a是new出来的对象二:function XXX(){ return 引用类型}则a是这个return的值如:function XXX(){ this.y = 10; return { x:1 }}var a = new XXX();console.log(a.x); //1console.log(a.y); //undefined 再如:function XXX(){ this.y = 10; return funct. 阅读全文