Created
April 19, 2017 13:31
-
-
Save andersonmadeira/284a10b7e9a8faf91391f5d6447c769a to your computer and use it in GitHub Desktop.
Make Random Array of Numbers
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
(function(numberOfElements, digits) { return new Array(numberOfElements).fill(0).map(function f(v) { return Math.floor( Math.random() * (digits == 1 ? 10 : Math.pow(10, digits)) + (digits == 1 ? 0 : Math.pow(10, digits)) ); } ); })(10,1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment