Created
June 12, 2016 15:01
-
-
Save jeffreymorganio/09305c0186509a6e05efe318983c2879 to your computer and use it in GitHub Desktop.
Create and fill a JavaScript array with random values.
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 randomDataSet(dataSetSize, minValue, maxValue) { | |
return new Array(dataSetSize).fill(0).map(function(n) { | |
return Math.random() * (maxValue - minValue) + minValue; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment