Chapter quiz · Type System Essentials

Test what you learned.

8 questions on Type System Essentials. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

TS Type System Essentials — Chapter Quiz

Eight questions on interfaces, unions, narrowing, and the special types.

0/ 9
  1. Question 1
    1

    What is the key difference between any and unknown?

  2. Question 2
    2

    Which type means a function never returns normally?

  3. Question 3
    3

    How do you combine two types so the result has all properties of both?

  4. Question 4
    4

    An interface can describe a union type like string | number.

  5. Question 5
    5

    What does TS infer about x inside the if-block?

    function f(x: string | number) {
      if (typeof x === "string") {
        // x is ___
      }
    }
    
  6. Question 6
    6

    What is a discriminated union's most useful feature?

  7. Question 7
    7

    A function isString(x): x is string is called a type ___.

  8. Question 8
    8

    Which keywords/modifiers control mutability of a property?

    Select all that apply.

Pick an answer — instant feedback as you go.