325
parseInt(5)
(lemmy.ml)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
But you're calling a function specifically made for passing a string to an int... ๐ There's gotta be some common sense somewhere here, guys.
Still, it's a very good point. JS should do this.
I would suspect one reason it doesn't do this is to be backwards compatible.