Skip to content

Instantly share code, notes, and snippets.

@dandean
Created December 17, 2010 17:07
Show Gist options
  • Select an option

  • Save dandean/745284 to your computer and use it in GitHub Desktop.

Select an option

Save dandean/745284 to your computer and use it in GitHub Desktop.
Array.slice.js
// 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