TypeScript Fundamentals: Types, Interfaces and Type Aliases
Learn TypeScript Fundamentals: Types, Interfaces and Type Aliases (Phase 10 · TypeScript with React (Essential for your chosen stack), ReactJS) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
JavaScript with a type checker • TypeScript adds static types to JavaScript. The compiler finds mistakes (wrong argument, missing property, possible undefined ) before the code runs, then erases the types, leaving plain JavaScript. • Basic types: string , number , boolean , null , undefined , arrays ( number[] or Array<number> ), tuples [string, number] , unknown (safe "anything"), any (turns checking off: avoid), void , never . • Annotate function parameters and return types; let TypeScript infer local variables.