JS experts of reddit, what javascript information do you have a hard time wrapping your head around

without acknowledging that the root of the problem is insufficient type checking at the source

That may be true, but if the frontend verified the expected type with ===, it would be aware that something was wrong. Whereas if it used == and just blindly carried on, it would likely result in a buggy/broken interface. If you're aware of the wrong data format, you can at least present an error message

If you're passing gobbledygook then GIGO should apply

Without a specific scenario it's hard to say, but I might argue that in this case, you probably shouldn't be comparing anything anyway (apart from maybe checking that the value is populated at all)

/r/javascript Thread Parent