DEV Community

Discussion on: Generating Random Whole numbers in JavaScript in a specific range

Collapse
 
codingjlu profile image
codingjlu

The "minified" form doesn't behave the same. In negative numbers, the first function is inclusive, while the second one is exclusive.

Run both about 30 times to see what I mean, and pass the values -10, -1.