number Math.random()
Returns a positive (pseudo) random number equal to or higher than 0 but less than 1.
To get a random number within a specific range you can use the next function.
var rand = function(low, high){ // low <= r < high
return low + ((high-low)*Math.random());
};
Or a version that only returns ints.
var rand = function(low, high){ // low <= r < high
return low + Math.floor((high-low)*Math.random());
};