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 are plain objects and nothing says what one must contain, so an order for a customer with no landmark prints "(near undefined)". Give the customer and the order a type each, so a malformed order cannot be written down — and handle the optional landmark.
Malformed orders are refused by the compiler, Order’s items are MenuItem[], and both descriptions print exactly.
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.