• marcos@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    10 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.