2 points · by js-coder · 13y ago · 1 comment
Number.prototype.to = function(to){r=[]; for(var i=this+0; i<=to; i++){ r.push(i)} return r;}
1..to(5) //[1,2,3,4,5]
GitHub - florian/range.js: JavaScript's missing range function.
JavaScript's missing range function. Contribute to florian/range.js development by creating an account on GitHub.
GitHub