Lesson overview · Free interview practice

TS Basics

Learn TypeScript fundamentals and setup.

Topics in the full lesson
  • Introduction to TypeScript
  • Setting Up TypeScript
  • TypeScript vs. JavaScript
  • Basic Types and Syntax
  • Interfaces and Type Aliases
  • Classes and Inheritance
  • Generics
  • Modules and Namespaces
  • TypeScript Compiler Options
  • Best Practices
  • Exercises

Practice Problems

Work through a question before revealing its explanation. These questions and answers are free; Premium adds the full lesson walkthrough, examples and implementation detail.

Completion marks record your own progress, not an automatically checked result. The task type does not determine whether it is optional.

TheoryEasy

TypeScript vs JavaScript

Question

What is TypeScript, and what does it add to JavaScript? Show equivalent code in each.

Take a moment to think about this before revealing the answer

Explain your reasoning or try an implementation before comparing answers.

TheoryEasy

Why TypeScript: The Value Proposition

Question

What does TypeScript give you that JavaScript doesn't? When is it NOT worth the cost?

Take a moment to think about this before revealing the answer

Explain your reasoning or try an implementation before comparing answers.

TheoryEasy

Type Erasure: TS Types Disappear at Runtime

Question

What does it mean that TypeScript "erases" types? Show what compiled output looks like and the practical consequences.

Take a moment to think about this before revealing the answer

Explain your reasoning or try an implementation before comparing answers.

TheoryMedium

Structural Type System: Types Compare by Shape

Question

What does it mean that TypeScript uses a structural type system? Contrast with nominal typing (Java, C#) and show the practical consequences.

Take a moment to think about this before revealing the answer

Explain your reasoning or try an implementation before comparing answers.

TheoryHard

TypeScript's Intentional Unsoundness

Question

Is TypeScript a sound type system? What does that mean, and where does TS deliberately accept unsoundness for ergonomic reasons?

Take a moment to think about this before revealing the answer

Explain your reasoning or try an implementation before comparing answers.

Explore the full TS Basics material

Premium includes the complete lessons and implementation references. Free practice questions remain available without a subscription.

All course tracks & premium content
From basics to advanced masterclasses
Built for JS/TS developers like you
Real-world tips & common pitfalls
Upgrade to Premium