Javascript Function

Why has the author of the quiz written the function like this . Look below

 function getRandomInt(min, max) {
     return Math.floor(Math.random() * (max - min)) + min;
 }
 
var temp = getRandomInt(0,3);
alert(temp);

The part that confuses me is why has he added "+min" at the end , what possibly does he want to achieve ?

Thanks .

gautam

Syndicate content