Created
November 10, 2019 07:07
-
-
Save TorvaldsDB/882b1557a1f4bcd8c80d876053e8fac3 to your computer and use it in GitHub Desktop.
JS how to return a sample of an 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
arr = [1, 2, 3, 4 , 5] | |
arr[Math.floor(Math.random() * arr.length)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment