Skip to content

Instantly share code, notes, and snippets.

@jashkenas
Forked from StanAngeloff/__slice.js
Created March 21, 2010 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jashkenas/339307 to your computer and use it in GitHub Desktop.
Save jashkenas/339307 to your computer and use it in GitHub Desktop.
var __slice = function(array, from, to) {
return array.slice(
from < 0 ? from + array.length : from || 0,
to < 0 ? to + array.length : to == 0 ? to : array.length
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment