that is common usage to get a random number between two values in JS. as unintuitive as it looks it's just more maintainable like that, the code was prolly just minified
Math.random() * (max - min) + min
that is common usage to get a random number between two values in JS. as unintuitive as it looks it's just more maintainable like that, the code was prolly just minified
Math.random() * (max - min) + min
whisper of the heart (1995) and spirited away (2001)
when i feel a little lost and lacking courage. a comfort / hopeful / nostalgia thing
it's not exactly the formula i posted but the principle is kinda the same
if u see it like this:
the diff is that it's inclusive of max (bc of +1) and it always returns an integer (bc of Math.floor)
btw not defending this abomination of a man in javascript language or anything lol