Answers for "how to generate a random number between certain values"

0

how to generate a random number between certain values

// How to generate a random number between specific values:

// Math.floor() rounds its argument down to the nearest whole number.
//Math.random() generates a float value between 0 and 0.999999999999999999999999

var highnum = 10 //Type your highest number here.
var lownum = 1 //Type your lowest number here.

var randomnumber = Math.floor(Math.random()*highnum + lownum)
Posted by: Guest on February-24-2021

Code answers related to "how to generate a random number between certain values"

Code answers related to "Javascript"

Browse Popular Code Answers by Language