• @marcos
    link
    51 day ago

    == has essentially no use unless you remember some completely arbitrary rules

    If you make sure the types match, like by explicitly converting things on the same line on that example, then you can use it just like if it was ===.

    In fact, there are people that defend that if your code behaves differently when you switch those two operators, your code is wrong. (Personally, I defend that JS it a pile of dogshit, and you should avoid going to dig there.)