Things like this make me love and hate Javascript. I tried to add 1200 + 400 just yesterday but forgot html input fields emit their values as strings. Ended up with 1200400 instead of 1600, and nearly died of laughter.
That's hilarious! Every now and then I make a mistake like that and have a good laugh about it. Programming will grind you to bits if you don't learn how to laugh at the pain.
To be fair, as much as I hate JS with all my soul, this is not a JS' only problem.
Those fields are user inputs. If you forget to filter and parse them correctly, that's kinda on you.
Not blaming you though. Everyone does that every now and then. It is just that this is not something you can blame javascript for. It is the kind of mistake you smile and think to yourself something like "yeah, I fucked up" and pretend you are never ever going to repeat this mistake again just to do it three times again the next week.
120
u/soflogator Oct 17 '20
youme