JavaScript with types. It checks your code while you type, then turns into plain JavaScript.
Why it exists
The problem
// JavaScript: crashes when it runs
const user = { name: "Ahmed", email: "[email protected]" };
user.emial.toLowerCase();
// 💥 TypeError: Cannot read properties of undefined
// TypeScript: caught while you type
const user = { name: "Ahmed", email: "[email protected]" };
user.emial.toLowerCase();
// ❌ Property 'emial' does not exist. Did you mean 'email'?
You need Node.js to run npm, TypeScript and your code.
node -v
npm -v