Created
November 20, 2018 14:55
-
-
Save quantumsheep/687047bf8f93f41c414b28d74a4ede0c to your computer and use it in GitHub Desktop.
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
/** | |
* @param {number} start | |
* @param {number} end | |
* @returns {number[]} | |
*/ | |
function range(start, end) { | |
if (start > end) return []; | |
return [...Array(end - start + 1).keys()].map(i => i + start); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment