DEV Community

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

 
jonrandy profile image
Jon Randy πŸŽ–οΈ

It isn't flooring in these cases - merely removing the decimal part.

Thread Thread
 
codingjlu profile image
codingjlu

Oh, I forgot to mentionβ€”it behaves just like Math.floor unless the value is negative.