In some coding practice websites, I found below assignment operation for generating a random whole number that falls within a range of two specific numbers.
To do this, we'll define a minimum number min and a maximum number max.
Here's the formula we'll use. Take a moment to read it and try to understand what this code is doing:
Math.floor(Math.random() * (max - min + 1)) + min
This formula is bit ambiguous to me. Could anyone please explain the logic.