function User (theName, theEmail) {
this.name = theName;
this.email = theEmail;
this.quizScores = [];
this.currentScore = 0;
console.log(this.name);
}
var user1 = new User("Some Name", "tafd@sdf.com");
console.log(name);
上面的代码似乎创建了全局变量。
答案 0 :(得分:-1)
都能跟得上!因为您的变量是在function
。