jonbretman
Re:Type Checking in JavaScript
on Wednesday November 06, 2013 @06:57AM (#6682232)
Firstly good spot on the '||' instead of an '&&'. Will fix that now.
Secondly I completely agree about wanting a program to crash noisily and detectably in development, but in production I would prefer that the error is handled and the user can continue to use the app.
Finally I also agree that if type checking is really important to you, a compile to JS language like TypeScript or Dart are the best options. The techniques / approach I am discussing in this article are really for people who already have a large vanilla JS code base or want to learn a bit more about types in JavaScript.