DEV Community

Discussion on: Pragmatic types: is JavaScript an untyped language?

Collapse
 
shalvah profile image
Shalvah • Edited

Yeah, I think one of the greatest errors in the language's design was choosing to make invalid math operations return NaN rather than throw an exception. Nine times out of ten, programmers don't intend to multiply 3 by "five", so why not fail immediately and loudly?