• marcos@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    6 months ago

    This evaluates to NaN for some reason:

    '10' % 0
    

    Since JS doesn’t really differentiate strings from numbers, except on the places it does, it makes sense to make sure you are working with numbers.