Module 1: Setup

1. Meet TypeScript

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'?

2. Install Node.js

You need Node.js to run npm, TypeScript and your code.

  1. Go to nodejs.org and download the LTS version.
  2. Run the installer and follow the steps.
  3. Open a new terminal and check it worked:
node -v
npm -v