AI Hints
Home›TypeScript Tutorial›Escape Hatches and Nulls
TypeScript · Lesson 12 of 120

Basics Quiz

Test yourself.

⏱ 2 min read▶ Video at 10:03🎓 Free
Watch this lesson in the TypeScript courseWatch on YouTube ↗Full TypeScript course

Let's review the basics. Pause after each question, and answer before I do.

Basics Quiz
From the video: Basics Quiz
  • Basics quiz
  • Pause and think
  • Then check

Question 1

What does TSC do? It checks types, and writes JavaScript.

Quick check
tsc:

Question 2

What's the type of a list of numbers? Number, with square brackets.

Quick check
A list of numbers is:

Question 3

Which type makes you check before using a value? Unknown.

Quick check
Safe type for unknown data:

Question 4

What does two question marks do? Gives a default for null or undefined.

Quick check
x ?? 'none' means:

Summary

Well done. Next, a new section on functions.

Key takeaways
  • tsc
  • number[]
  • unknown
Next up: Functions — typed parameters