Chapter quiz · Functions & Inference

Test what you learned.

8 questions on Functions & Inference. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

TS Functions & Inference — Chapter Quiz

Eight questions on function types, parameters, overloads, and inference.

0/ 8
  1. Question 1
    1

    What is the function type expression for a function that takes a string and returns a number?

  2. Question 2
    2

    How do you mark a function parameter as optional?

  3. Question 3
    3

    TS can infer the return type of a function — you don't have to annotate it.

  4. Question 4
    4

    What does the void return type mean for a callback?

  5. Question 5
    5

    What is the inferred return type of add?

    function add(a: number, b: number) {
      return a + b;
    }
    
  6. Question 6
    6

    What is a rest parameter typed as?

  7. Question 7
    7

    When you declare multiple function signatures for the same name, the pattern is called function ___.

  8. Question 8
    8

    Which special parameter slot is used to type the value of this inside a method?

Pick an answer — instant feedback as you go.