Skip to content
KALANBLON
Show contents

Chapter 7 of 7 · 10 min

Quiz: type an application

Generics, utility types, outside data and asynchronous code: the last quiz of this course. You need 70% correct answers to pass it.

Quiz

7 questions · pass mark: 70%

  1. 1.With function first<T>(e: T[]): T | undefined, what is the type of x in const x = first(["a", "b"])?

    One answer

  2. 2.Why write T extends { price: number }?

    One answer

  3. 3.What does Partial<Product> give?

    One answer

  4. 4.For data received from an API, which practices are safe? (several answers)

    Several answers possible

  5. 5.Complete the return type of an async function that returns a number.

    Complete the code

    async function total(): _______<number> { … }
  6. 6.In catch (e), what is the type of e in strict mode?

    One answer

  7. 7.Why store amounts as whole units (cents, CFA francs)?

    One answer

Your progress is saved on this device. Create a free account to keep your progress on all your devices.