87,964
社区成员
发帖
与我相关
我的任务
分享
Date.prototype.toString=function(){
return 11;
}
Date.prototype.valueOf=function(){
return 22;
}
var b1 = new Date();
var b2 = new Date();
console.log("b1.toString():"+b1.toString());
console.log("b1.valueOf():"+b1.valueOf());
console.log("b1+b2:"+(b1+b2));
function circle(){
this.toString=function(){
return 11;
};
this.valueOf=function(){
return 33;
}
}
var cir1 = new circle();
var cir2 = new circle();
console.log("cir1+cir2="+(cir1+cir2));