Javascript this 关键字 详解
一、this指向构造函数实例化对象在上篇文章中,我们提到了使用new和不使用new调用构造函数的区别,如下例:复制代码 代码如下:function Benjamin(username, sex) { this.username = username; this.sex = sex;}var benjamin = new Benjamin("zuojj", "male");//Outputs: Benjamin{sex: "male",username: "...