i am confused about Math.Random()
in javascript in know that this function will return a number between 0
and 1
i am trying to return a number between 400 and 500 and what i did is this :
var y = Math.floor((Math.random() * 400) + 100);
but this code may return a value of 100
or 200
what is the best practice to create a number where the minimum is n0
and maximum is n1
No comments:
Post a Comment