Last active
May 26, 2020 19:11
-
-
Save galElmalah/66b49f69f9b1346eb709b5088bacb895 to your computer and use it in GitHub Desktop.
creating and shuffling array
This file contains 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 shuffledArrayInRange = (bottom = 1, top = 30) => { | |
const arr = []; | |
for (let i = bottom; i < top; i++) arr.push(i); | |
return arr.sort((a, b) => (Math.random() > 0.5 ? 1 : -1)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment