How can I generate random whole numbers between two specified variables in JavaScript, e.g. x = 4
and y = 8
would output any of 4, 5, 6, 7, 8
?
1 Replies
Hello miss, try this visibility
var randomnumber = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;