Created
December 17, 2010 17:07
-
-
Save dandean/745284 to your computer and use it in GitHub Desktop.
Array.slice.js
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
| // ES5 Array.slice polyfill. | |
| // Lets you easily turn array-like objects into actual arrays: | |
| // Array.slice(arguments).map(...); | |
| if (!Array.slice) { | |
| Array.slice = function(array, start, end) { | |
| return Array.prototype.slice.call(array, start, end); | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment