Lesson 30 of 55
javascriptIntro to TypeScript (Optional)
12 mins
Course progress55%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 30 of 55
javascript12 mins
Keep these ideas in mind as you work through the lesson.
TypeScript adds static typing on top of JavaScript.
npm install -D typescript
npx tsc --init
tsconfig.json
{
"target": "es2020",
"module": "esnext",
"strict": true,
"sourceMap": true
}
Simple TS file:
function greet(name: string): string {
return `Hi, ${name}`;
}
console.log(greet('World'));
npx tsc..js to .ts one file at a time.