Created
January 4, 2017 14:58
-
-
Save edoardoo/61509ed88547b9fa83d1b2d2a1735869 to your computer and use it in GitHub Desktop.
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.rotate = function(count) { | |
| var tmpArray = this.slice(); | |
| count -= this.length * Math.floor(count / this.length); | |
| tmpArray.push.apply(tmpArray, tmpArray.splice(0, count)) | |
| return tmpArray | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment