标签:
直接上代码:
String.prototype.repeatify = String.prototype.repeatify || function(times){
var str = ‘‘;
for (var i=0;i < times;i++){
str += this;
}
return str;
}
console.log("hello".repeatify(3)); =====> "hellohellohello"
标签:
原文地址:http://www.cnblogs.com/xiaoheimao2008/p/4640694.html