3 ms·
Why would you write a test instead of a type declaration if you had the choice?
by stevenwliao 7y ago
Why would you write a test instead of a type declaration if you had the choice?
- arkanciscan 7y agoTS checks at buildtime. It can't guard against runtime TypeErrors because JavaScript is a dynamic language (despite all the effort to "fix" that). Tests can catch all TypeErrors, TS can't. Why use two tools to do the job that one can do alone?