Created
May 22, 2013 10:05
-
-
Save lotsofcode/5626525 to your computer and use it in GitHub Desktop.
javascript duplicate function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.prototype.duplicate = function() { | |
| return this.concat(this); | |
| } | |
| var duped = [1,2,3,4,5].duplicate() | |
| console.log(duped) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment