Learn TypeScript for Free: Beginner Course with a Live Type Checker (English and Arabic)
NeedMyTools Academy
Start free: sign in first
One free account opens every full lesson, the graded tests, your progress on any device and a certificate of completion. Sign in with an email code or Google in under a minute.
- Full lessons and exercises
- Graded tests that unlock the next lesson
- Certificate with a QR code anyone can verify
Free forever. No card, no paywall.
Already signed in? The same button opens your panel.
Just looking? Each lesson shows a short preview without an account.
TypeScript is JavaScript with types. You write the same code you already know, and add short notes such as "this is a number" or "this object has a name and a price". A program called the TypeScript compiler reads those notes and warns you about mistakes before the code ever runs: a misspelt property, a string where a number belongs, a value that might be missing. Then it removes the notes and gives you plain JavaScript for the browser. Most large web projects, and many small ones, are now written this way. This course assumes you have finished the JavaScript course here, or know the same basics, and every example runs the real compiler in your browser so you see its errors as you edit.
Quick answer
Learn TypeScript after JavaScript, in this order: basic types and type inference; interfaces and type aliases for objects; union types, literal types and narrowing; generics; typing functions, objects and data from APIs; then tsconfig and strict mode for real projects; then classes, tuples, enums and satisfies; and finish with a project that combines them. Write types where they help a reader, such as function parameters and data shapes, and let TypeScript infer the rest.
- Level:
- Beginner to intermediate, after JavaScript
Lessons
- 1Why TypeScript and basic typesRead a TypeScript error message and find the line and the cause · Annotate variables, arrays, parameters and return values with basic types · Let inference do the work and know when an annotation helps · Handle values that may be null, and choose unknown over any30 min
- 2Interfaces and type aliasesName the shape of an object with interface or type and use it as a type · Use optional and readonly properties and arrays of objects · Extend and combine types with extends and & · Explain structural typing and choose between interface and type30 min
- 3Unions, narrowing and literal typesWrite union types and literal types for values with a few possible forms · Narrow unions with typeof, truthiness, in, Array.isArray and equality · Model cases with discriminated unions and switch on them · Use never to make the compiler find unhandled cases35 min
- 4GenericsRead and write generic functions with a type parameter such as T · Use built-in generic types: Array<T>, Promise<T> and Map<K, V> · Write generic types such as Result<T> and Page<T> for data wrappers · Limit a type parameter with extends and keyof35 min
- 5Typing functions, objects and APIsType optional, default and rest parameters, and callbacks with function types · Derive object types with Partial, Pick, Omit, Readonly and Record · Type async functions and check JSON from an API before trusting it · Get the right element and event types from the DOM40 min
- 6tsconfig and strict modeInstall TypeScript, create tsconfig.json and run tsc · Explain what strict mode switches on and why to keep it · Type check in projects built with Vite, Next.js or Node.js · Choose honest escape hatches and migrate JavaScript gradually35 min
- 7Classes and access modifiersDeclare typed fields, constructors and parameter properties · Choose between public, private, protected, #private and readonly · Check a class against an interface with implements · Decide when a class is better than plain objects and functions35 min
- 8Tuples, enums and satisfiesUse tuples, with labels, for fixed-length values such as coordinates · Read enums and choose a literal union or an as const object instead · Check configuration objects with satisfies without losing exact types · Describe string formats with template literal types35 min
- 9Project: a typed order summaryCombine interfaces, unions, generics and narrowing in one feature · Check external data with a type guard before using it · Calculate money safely in whole fils, with VAT and discounts · Wire typed DOM elements and events into a working page55 min
NeedMyTools Academy
Sign in with a free account (email code or Google, no password) to open every lesson in full. Each lesson ends with a short test graded on our server, and the next lesson only unlocks after you pass. Pass the module tests, the final project and the final exam to get a certificate of completion with a transcript that anyone can check on this site. Without an account you can read a short preview of each lesson.
How grading works
- Each lesson: pass the exercise (checked on our server), then a 5-question test with 4 correct. The test opens after you have spent some time on the lesson.
- Three fails in a row lock that test for 30 minutes. Leaving a test unfinished counts as a fail.
- Each module ends with a 10-question test (7 to pass, 3 tries a day). The course ends with the project and a 25-question final exam (18 to pass, 3 tries a day).
- Questions are drawn at random and many have values that change for every student, so sharing answers does not help.
- The certificate says what it is: a certificate of completion for an unsupervised online assessment, not a degree or an accredited qualification.
What you will be able to do
- Add types to variables, functions and objects, and know when inference is enough
- Describe data with interfaces and type aliases, including optional and readonly properties
- Model choices with union and literal types and narrow them safely
- Read TypeScript error messages and fix the cause, not the symptom
Who this course is for
People who can write basic JavaScript, with variables, functions, objects, arrays and fetch, and now want fewer bugs and clearer code. It suits students preparing for front end jobs, developers joining a team whose code is in TypeScript, and anyone about to learn React, Next.js or Node.js, where TypeScript is now the usual choice. You need no tools: a modern browser on a computer is best, and the examples also work on a phone.
Why TypeScript is worth learning
JavaScript lets you do almost anything, which is also why bugs hide in it: nothing stops you from adding a string to a number or reading a property that does not exist until a user hits that line. TypeScript moves many of those discoveries to the moment you type. Editors such as Visual Studio Code use the same types to suggest property names, show what a function expects and rename things safely across a project. Microsoft created the language in 2012 and it is free and open source. Job listings for front end and full stack roles now ask for it very often.
How the examples run
Each example is a small page with a `<script type="text/typescript">`. Nothing heavy loads with the page: when you press Run or edit the code, your browser downloads the official TypeScript compiler from a public CDN, checks the script in strict mode, prints every type error in the Console box with its line number, then turns the script into JavaScript and runs it. The first run takes a few seconds while the compiler, about 1.8 MB, loads; later runs are quick. Like the real `tsc` command, the JavaScript still runs when there are type errors, so you can see both the warning and what would have happened. The exercises are checked by reading your code as text, never by running it on our server.
What TypeScript does not do
Types exist only while you write and compile. They are removed before the code runs, so they cannot check what a person types into a form or what an API sends back. A value typed as a number can still arrive as a string from outside. That is why the lessons keep the habits from the JavaScript course: convert and validate input, check `response.ok`, handle errors. TypeScript makes your own code consistent; checking data from the outside world is still your job, and later lessons show how the two work together.
Where the facts come from
The TypeScript Handbook on typescriptlang.org, written by the TypeScript team, is the main reference for this course, together with the compiler itself: every error message you see in an example comes from the pinned compiler version, not from us. Each lesson lists the exact pages we checked and the date we checked them, and says when a feature needs a recent version of TypeScript.
After this course
- React · LiveBuild interfaces from components: JSX, props, state, effects and forms.
Questions about this course
Should I learn JavaScript before TypeScript?
Yes. TypeScript is JavaScript plus types, so every line you write is still JavaScript underneath. Learn variables, functions, objects, arrays and async code first; the free JavaScript course here covers all of them.
Is TypeScript a different language from JavaScript?
Not really. It is a superset: any valid JavaScript is valid TypeScript syntax, and TypeScript only adds type annotations and a few related features. The compiler removes the types and outputs normal JavaScript that runs anywhere.
Does TypeScript make my website faster?
No. The types are removed before the code runs, so the browser gets the same kind of JavaScript you would have written by hand. The gain is fewer bugs and faster, safer development, not faster pages.
Is this TypeScript course free and in Arabic?
Yes. Every lesson is in English and Arabic, with no signup needed to read it. The code and the compiler’s error messages stay in English, as they do in real projects, and the lessons explain what each message means.
What do I need to use TypeScript in my own project?
Node.js and the typescript package from npm, which gives you the `tsc` command, or a build tool such as Vite that understands TypeScript out of the box. Visual Studio Code shows type errors as you type without any extra setup.
Code examples stay in English and run in a sandbox on your device. If you spot a mistake, tell us through the contact page.