1.相关知识点 (1)构造函数 (函数名首字母大写表示构造函数) function Foo(name,age){ this.name = name; this.age = age; this.class = 'class'; //return this; 默认有这一行,浏览器帮忙做了 } var f = new Foo('chenyan',25); // new 执行时,this先变成一个空对象,然后再Foo函数里给this赋值,最后返回this console.log(f instanceo…