87,909
社区成员
发帖
与我相关
我的任务
分享
function test(b){
this.b=b;
.....
}
var s = 'test';
function test(b){
this.b=b;
}
test(s); //结果是window.b为'test'
var t = new test(s); //结果是t.b为'test'
function test(b){
this.b=b;
this.method=function(){
document.write(this.b);
}
}
var t=new test('who');
t.method();
}
var s = 'test';
function test(b){
this.b=b;//this.a=b;这里写a那么a的结果就是test
}
test(s); //结果是window.b为'test'
var t = new test(s); //结果是t.b为'test'