String.prototype.repeatify=String.prototype.repeatify || function(times){
var str='';
for(var i=0;i<times;i++){
console.log('this',this)
// this指向调用这个函数的对象
str+=this;
}
return str
}
'hello'.repeatify(3)======>'hellohellohello'
String.prototype.repeatify=String.prototype.repeatify || function(times){
var str='';
for(var i=0;i<times;i++){
console.log('this',this)
// this指向调用这个函数的对象
str+=this;
}
return str
}
'hello'.repeatify(3)======>'hellohellohello'