TypeScript basicsbeginner
A type is a note to your future self that the compiler checks — annotating what goes in and what comes out is where most of the value is, before any advanced feature.
orders.js has just become orders.ts with strict on. It has three bugs nobody noticed: a typo that makes the total NaN, an id that arrives as a string and finds nothing, and no types at all. Give the compiler enough to find them, then fix what it finds.
Compiles clean under strict with no any, the total is right, and the form value is converted at the edge.
Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.
A type is a note to your future self that the compiler checks — annotating what goes in and what comes out is where most of the value is, before any advanced feature.