Basic types
Learn Basic types (Module 2 · TypeScript, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Type annotations, inference and primitives • A type annotation labels a variable like a name tag on a jar: let age: number = 30; . With type inference the compiler reads the value and fills the tag for you, so let age = 30 is already a number. Annotate function parameters and public APIs; let inference handle locals. • Primitive data types : string, number (all numbers, no int/double), boolean, bigint, symbol, null, undefined. Use lowercase names, never String or Number objects.