Skip to content

Instantly share code, notes, and snippets.

@argshook
Created November 14, 2013 13:23
Show Gist options
  • Save argshook/7466710 to your computer and use it in GitHub Desktop.
Save argshook/7466710 to your computer and use it in GitHub Desktop.

Revisions

  1. argshook revised this gist Nov 14, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion repeatString.js
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,4 @@ String.prototype.repeat = function(times) {

    var str = "1".repeat(3);

    console.log(str);
    console.log(str); // 111
  2. argshook created this gist Nov 14, 2013.
    7 changes: 7 additions & 0 deletions repeatString.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    String.prototype.repeat = function(times) {
    return (new Array(times + 1)).join(this);
    };

    var str = "1".repeat(3);

    console.log(str);