Last active
December 22, 2017 17:39
-
-
Save Woodsphreaker/997d25ac28755cebe346f4b3ac86bd1d to your computer and use it in GitHub Desktop.
range.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const range = (start = 0, end = 1) => Array.from({"length": (end + 1) - start}, (_, i) => start + i) | |
console.log(range(-10, 10)); // [ -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment