DevAcademy

TypeScript Advanced Practice

27 questions covering 9 TypeScript topics.

Quick Quiz

1. What does Partial<User> do?

2. What is the difference between Pick and Omit?

3. What does ReturnType<typeof someFunction> give you?

4. What does a mapped type do, conceptually?

5. What does the -? modifier do inside a mapped type?

6. What does the as clause inside a mapped type allow?

7. What does T extends U ? X : Y mean?

8. What does the infer keyword do inside a conditional type?

9. What happens when a conditional type is applied to a union type?

10. What does a function return type like value is User indicate?

11. Why are custom type guards useful for validating unknown data?

12. Does TypeScript verify that a type guard’s implementation is actually correct?

13. Does TypeScript use a different import/export syntax from JavaScript?

14. What does import type guarantee?

15. Should new TypeScript projects use namespaces or ES modules?

16. What does a .d.ts file contain?

17. What is DefinitelyTyped?

18. What does declare const APP_VERSION: string do?

19. What does a decorator let you do?

20. What is a decorator factory?

21. Which frameworks commonly use decorators as part of their API?

22. What does the target option control?

23. Is noUncheckedIndexedAccess included in strict mode by default?

24. What does skipLibCheck do?

25. Why start a project with strict mode enabled from the beginning?

26. Why should data from an external API be validated, not just typed?

27. What is the benefit of modeling state as a discriminated union instead of many optional fields?