Link to home
Start Free TrialLog in
Avatar of Isabell
Isabell

asked on

Getting Random number with min and max value.

I know that the following code will get me a random number between 3 and 10.
Can anybody explain the third line of the code step by step?

var max = 10;
var min = 3;
Math.max(Math.floor(Math.random() * max) + 1, min)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of dpearson
dpearson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Isabell
Isabell

ASKER

Wow. very impressed with your answer. Thanks!