• luciferofastora@lemmy.zip
    link
    fedilink
    arrow-up
    1
    ·
    2 years ago

    But what if I don’t want strict comparison? What if my frontend contains a text field for a numeric input and I wanna manually check against each possible valid input value if (input_val == 1) {...} else if (input_val == 2) {...} else if... without having to convert it first or check that it’s actually a number or fix my frontend?

    (I’m sure there are valid use cases for non-strict comparison, I just can’t think of one right now)