I need an explanation to this line

in this line of code

Math.floor(Math.random() * (max - min + 1)) + min

what the - min + 1 is for i understand the +min in the end and max

if you want a random number between 10 and 20 you have 11 possible numbers
max - min + 1 gives the value of the range (in this case 20 - 10 + 1 is eleven)

1 Like

ok got it thx for your time