• JRaccoon@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    8
    ·
    17 hours ago

    Also wtf is up with the 100 - 1 + 1 expression? Is this some weird JavaScript quirk?

    If searching online for a JS random number generator code, something like Math.floor(Math.random() * (max - min + 1) ) + min; is the most common result. If you’re lazy or don’t care, you just fill in the min and max and get that 100 - 1 + 1