Skip to content

Instantly share code, notes, and snippets.

@shawndumas
Last active August 29, 2015 13:56
Show Gist options
  • Save shawndumas/8848023 to your computer and use it in GitHub Desktop.
Save shawndumas/8848023 to your computer and use it in GitHub Desktop.
Stupid Hack for a Range Function
var range = function (from, to) {
if (arguments.length === 1) { to = from; }
var a = new Array(to + 1).join(0).split(0).map(function (v, i) { return i; });
if (from !== to) { a = a.slice(from, a.length); }
return a;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment