O'Reilly logo
  • Ahmed Elgendy thinks this is interesting:

I don’t think so. I provide a valuable service. Who doesn’t want to, say, compare user input in the form of a string to a number every once in a while?


Cover of Head First JavaScript Programming


Why does Javascript offer this type conversion when making comparisons between different variables? A tip: it is all about the language main usage. Let's not forget that Javascript is designed to make interactive and dynamic websites. And in order to do that, Javascript handles entries made by users who are not strict about data types.