Learn the fundamentals of TypeScript, including its syntax, features, and how to leverage its benefits in your JavaScript projects. Whether you are a beginner or an experienced JavaScript developer, this course will provide you with a solid foundation in TypeScript. π
The TypeScript Handbook is a comprehensive guide that covers various aspects of TypeScript. It is a great resource for your daily TypeScript work. The handbook covers the following topics:
- noImplicitAny: Disable implicit variable type assignment with
any = unknown
. TypeScript will never infer types of arrays.any
is mostly used with strings. - enums: Enums can be defined with string or number values. Enums default to 0.
- definitely typed: Refers to a project that involves a central repository of definitions for npm packages which do not have types, specified in
tsconfig.json
. - overriding: When a class extends another class and replaces the members of its parent, it is called overriding.
- implicit:
firstName = "John";
- explicit:
firstName: string = "John";
- disabled type checking:
let myVar: any;
- unknown:
let myVar: unknown;
- no array changes:
const names: readonly string[] = ["Dylan"];
- loosely typed: Refers to vanilla JavaScript.
- tuple:
let ourTuple: [number, boolean, string];
- an array of mixed types.
The reference section provides deep dive materials and reference guides for TypeScript:
Learn how to use TypeScript in various environments and frameworks:
Declaration files are important for describing existing JavaScript libraries and frameworks. Learn how to write declaration files and contribute to DefinitelyTyped:
Discover how to leverage TypeScript-powered JavaScript tooling:
Learn about the tsconfig.json file and how to configure the TypeScript compiler:
Downloadable syntax reference pages for different parts of everyday TypeScript code:
For more detailed information, you can download PDFs and PNGs of the cheat sheets.
We hope you find this documentation helpful in your TypeScript journey. Happy coding! π