• Sleepless One@lemmy.ml
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 days ago

    In JS at least, there’s a concept of truthiness and falsiness. 0, undefined, null, and a few other non-boolean values are treated as false if used in conditionals and logical operations, while every other value is treated as true. I’m pretty sure python has something similar.