我已经制作了我的自定义对象,我想添加一个方法。我想将我的值大写。但它给了我[object object]。知道如何完成它。小提琴
function checkObj (name,title,salary){
this.name= name;
this.title= title;
this.salary= salary;
}
var woo=new checkObj("rajora","this is a test",2000);
checkObj.prototype.inc=function (){
for(i=0;i<this.length;i++){
this[i]= this[i].toUpperCase();
}
};
woo.inc();
console.log(woo)