Skip to content

Instantly share code, notes, and snippets.

@StanAngeloff
Created March 21, 2010 13:25
Show Gist options
  • Save StanAngeloff/339298 to your computer and use it in GitHub Desktop.
Save StanAngeloff/339298 to your computer and use it in GitHub Desktop.
Array.prototype.slice.call(
(Object.prototype.toString.call(source) !== "[object Array]") ? (_a = source.toString().split("")) : (_a = source),
(typeof from !== "undefined" && from !== null) ? from < 0 ? (from = from + _a.length) < 0 ? 0 : from : from : 0,
(typeof to !== "undefined" && to !== null) ? (to = to < 0 ? to + _a.length : to) < 0 ? (to = from) : to > _a.length ? (to = _a.length) : to : _a.length
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment