Language basics: TypeScript
Основы TypeScript и JavaScript для разработчика с нуля: основы JS, асинхронность и event loop, модули и npm, базовые типы, дженерики, сужение типов, классы и декораторы, инструменты.
The first phase of the program is the language the frontend and the Node backend are written in: first the necessary minimum of JavaScript, then TypeScript on top of it. From scratch and in plain words: JS essentials, async and the event loop, modules and npm, types and inference, generics, narrowing, classes and decorators, build tooling. Best read in order.
- JavaScript essentials — Where to start: let/const, data types, functions and arrows, objects, arrays, destructuring, and why === beats == — the base before TypeScript.
- Basic TypeScript types: annotations, inference, union and any — Why TypeScript on top of JavaScript, how annotations and type inference work, how type differs from interface, what union, literals, any, unknown and never are.
- Narrowing and guards in TypeScript — How TypeScript narrows types via typeof, instanceof, in and null checks, what user-defined type guards are, discriminated unions and working with unknown.
- Generics in TypeScript: reusable type-safe code — What a generic is in TypeScript and why you need it: generic functions, types and interfaces, constraints via extends and the basic utility types in plain words.
- Classes and decorators in TypeScript — TypeScript classes from scratch: fields, access modifiers, the constructor, inheritance, abstract classes and interfaces. What decorators are and why NestJS uses them.
- Async and the event loop in TypeScript — How Node runs asynchronous code on a single thread: the event loop in plain words, the path from callbacks to Promise and async/await, error handling and parallel operations.
- Modules and npm: how code is assembled from parts — How TypeScript code splits into modules (import/export vs require), why package.json exists, how dependencies differ from devDependencies and what semver is.
- TypeScript and Node tooling: where to start — Node and npm/pnpm, the tsc compiler and tsconfig.json, running via tsx, project structure and linters — the minimal set to start writing TypeScript.