Javascript String rep(times)
String.prototype.rep = String.prototype.rep || function(times){ var s = '' for(var i=0;i<times;i++){ s += this;//from ww w .j a v a 2s .co m } return s; }