# Learn TypeScript > Free TypeScript tutorials, plus how to use the type system as a correctness harness for AI-generated code. Canonical: https://learn-typescript.org/ Licence: content free to read and quote with attribution to Learn TypeScript (https://learn-typescript.org/). Maintainer: Code Learning Dojo. Last built 2026-09-06. ## Foundations The syntax and the mental model. Short, runnable, no fluff. - [Hello, World!](https://learn-typescript.org/hello-world/): Your first TypeScript file, and the two commands that check it and run it. - [Variables and Types](https://learn-typescript.org/variables-and-types/): TypeScript is JavaScript plus a type checker. This is where the types start — and where you stop writing var. - [Arrays](https://learn-typescript.org/arrays/): TypeScript arrays are JavaScript arrays with an element type — `string[]` rather than a bag of anything. - [Manipulating Arrays](https://learn-typescript.org/manipulating-arrays/): Arrays can also function as a stack. The push and pop methods insert and remove variables from the end of an array. - [Operators](https://learn-typescript.org/operators/): The arithmetic, comparison and logical operators, and the two TypeScript-relevant ones: ?? and ?. - [Conditions](https://learn-typescript.org/conditions/): The if statement allows us to check if an expression is equal to true or false, and execute different code according to the result. - [Loops](https://learn-typescript.org/loops/): for, for...of, for...in and while — and which one to reach for. - [Objects](https://learn-typescript.org/objects/): Objects hold keyed values, and in TypeScript the set of keys and their types is part of the type. - [Functions](https://learn-typescript.org/functions/): Functions are code blocks that can have arguments, and function have their own scope. - [Pop-up Boxes](https://learn-typescript.org/pop-up-boxes/): There are three types of pop-up boxes in javascript: confirm, alert, and prompt. - [Callbacks](https://learn-typescript.org/callbacks/): Passing a function to another function — and typing its signature so the parameters come out inferred. - [Arrow Functions](https://learn-typescript.org/arrow-functions/): Arrow functions are a feature of ES6, their behavior are generally the same of a function. - [Object Oriented JavaScript](https://learn-typescript.org/object-oriented-javascript/): JavaScript uses functions as classes to create objects using the new keyword. - [Function Context](https://learn-typescript.org/function-context/): Functions in JavaScript run in a specific context, and using the this variable we have access to it. - [Inheritance](https://learn-typescript.org/inheritance/): JavaScript uses prototype based inheritance. - [Destructuring](https://learn-typescript.org/destructuring/): Destructuring is a feature of ES6, introduced for making easier and cleaner some repetitive operations and assignments made in JS. - [Functions and Signatures](https://learn-typescript.org/functions-and-signatures/): A function signature is the most valuable annotation you will write — it is a contract the compiler enforces at every call site. - [Interfaces and Type Aliases](https://learn-typescript.org/interfaces-and-type-aliases/): Naming the shape of your data is the point at which TypeScript starts paying for itself. - [Union Types and Narrowing](https://learn-typescript.org/union-types-and-narrowing/): A union says a value is one of several things. Narrowing is how you prove which one — and it is the most distinctively TypeScript skill there is. - [Generics](https://learn-typescript.org/generics/): A generic is a type with a hole in it. They look intimidating and the everyday use is genuinely simple. - [Classes and Access Modifiers](https://learn-typescript.org/classes-and-modifiers/): TypeScript adds real access control, parameter properties and interface implementation to JavaScript classes. - [Async and Promises](https://learn-typescript.org/async-and-promises/): Typing asynchronous code, and the lint rule that catches the most common bug in TypeScript and JavaScript alike. - [tsconfig and Strictness](https://learn-typescript.org/tsconfig-and-strictness/): The most important file in a TypeScript project. Four flags beyond strict do most of the real bug-catching, and all four are off by default. ## AI-Native Configuring agents, harnesses and feedback loops for this language. Updated as the tooling moves. - [The type system is the best prompt you will ever write](https://learn-typescript.org/ai/types-as-harness/): A type is a specification the compiler enforces on every edit, for free, forever. That makes TypeScript unusually well suited to a workflow where a machine writes most of the code. - [Writing an AGENTS.md for TypeScript](https://learn-typescript.org/ai/agents-md/): Half of what people put in a TypeScript instructions file belongs in tsconfig.json instead, where it is enforced rather than suggested. - [Type-safe LLM applications in TypeScript](https://learn-typescript.org/ai/evals/): A model returns a string. Your application needs a value. Everything interesting about building LLM apps in TypeScript happens at that boundary — and it is the one place `as` will hurt you most. - [Making token budgets a type error](https://learn-typescript.org/ai/tokenomics/): You cannot type-check a bill. You can make it impossible to call a model without a budget, impossible to confuse dollars with tokens, and impossible to add a call site nobody is measuring. ## Review & Verify How generated code fails in this language, and the checks that catch it before your users do. - [The TypeScript mistakes language models actually make](https://learn-typescript.org/review/failure-modes/): The compiler catches a lot. What survives is almost always the compiler being told to look away. - [Dependency hygiene for TypeScript projects](https://learn-typescript.org/review/dependencies/): Everything npm does wrong, plus a second parallel dependency graph made of type definitions that nobody reviews. - [Security review for TypeScript: what types do and do not buy you](https://learn-typescript.org/review/security/): Types are erased at runtime, so an attacker never sees them. The security value of TypeScript is real but indirect — and generated code reaches for the escape hatches at exactly the wrong moments. - [Build performance: the TypeScript bottleneck nobody profiles](https://learn-typescript.org/review/performance/): Runtime performance is JavaScript's problem and is covered there. TypeScript's own performance problem is the compiler — and a slow one directly degrades the quality of everything an agent writes. ## Reference pages - [About Learn TypeScript, and how we make money](https://learn-typescript.org/about/): Editorial policy, sourcing, corrections and affiliate disclosure for Learn TypeScript, part of the Code Learning Dojo network. - [The TypeScript stack we would set up today](https://learn-typescript.org/tools/): An opinionated TypeScript toolchain: tsconfig, ESLint, Vitest, validation libraries, package managers, editors and hosting — plus the tools that are now redundant.