rand number in JS:
var randomnumber=Math.floor(Math.random()*11)
for 0-10
http://www.javascriptkit.com/javatutors/randomnum.shtml
in a range:
function getRandom(min, max) {
var randomnumber= Math.floor(Math.random()*(max-min))+min;
console.log(randomnumber);
return randomnumber;
}
Wednesday, February 27, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment