Javascript Math Random Float Numbers

Description

Javascript Math Random Float Numbers


// Will return a number between min (inclusive) and max (exclusive)
Math.randomFloat = function(min, max) {
     return Math.random() * (max-min) + min;
}

console.log(Math.randomFloat(1.2,3.4));



PreviousNext

Related