/ Published in: JavaScript
Expand |
Embed | Plain Text
String.prototype.times = function(num){ return (num <= 0)? "": this.concat(this.times(--num)); }; alert("#".times(3));//show:###
You need to login to post a comment.
String.prototype.times = function(num){ return (num <= 0)? "": this.concat(this.times(--num)); }; alert("#".times(3));//show:###
You need to login to post a comment.