Last active
March 27, 2023 04:14
-
-
Save va9iff/bc02088e0460d528c98526269266dacb to your computer and use it in GitHub Desktop.
quick one-liner for creating array from range. range(n) returns [0, 1, ..., n]; range(n, k) returns [k, k+1, ..., n]
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 = (b = 1, a = 0) => [...Array(b - a).keys()].map(i => i + a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment