a dead-serious goofball :-)
open to friends, feel free to dm!!!
- 1 Post
- 3 Comments
Joined 14 days ago
Cake day: July 23rd, 2026
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
aura@lemmy.dbzer0.comto
Fediverse@lemmy.world•Tesseract dev injects malicious code into browser to illegally DDOS the dbzer0 instanceEnglish
12·10 days agothat 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


it’s not exactly the formula i posted but the principle is kinda the same
if u see it like this:
let min = 1 let max = 100 let random = Math.floor(Math.random() * (max - min + 1)) + minthe 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