Node.js examples for Number:Random Number
Get random within a range
Util.getRandom = function(min, max) { if(arguments.length > 1) { return Math.random() * (max - min) + min; } else {//w w w . j a va 2s . c o m return Math.random() * min; } }