In this video, you looked back at how you moved Spoke & Sprocket’s quote calculator from JavaScript to TypeScript, until the checker reported nothing and every quote matched Dee’s.
What You Can Do Now
- Set up a small Node project to check and run TypeScript
- Annotate functions and objects where inference needs help
- Read a type error back to its cause
- Say what
anygives up
Two Times, Two Jobs
- Before the program runs, the checker reads your types and reports what doesn’t fit. In your project,
npm run checkasks it, throughtsc --noEmit. - While it runs, the types are gone, and plain JavaScript runs.
node quote.tsruns the quotes.