TypeScript Advanced Features

Explore generics,decorators,utility types,and advanced type manipulation.

1. What is the primary purpose of generics in TypeScript?
2. Which of the following are built-in TypeScript utility types? (Select all that apply)
3. TypeScript interfaces can be extended, but type aliases cannot.
4. What utility type constructs a type by picking the set of properties K from T?
5. Which type is used to represent values that are guaranteed to never occur?
6. Which of the following are valid type guards in TypeScript? (Select all that apply)
7. What is the difference between 'unknown' and 'any'?
8. Which type represents a value that could be one of several types?
9. What does the 'readonly' modifier do in TypeScript?
10. Which utility types transform the properties of a type? (Select all that apply)
11. Mapped types create new types by transforming each property of an existing type.
12. What is the syntax for a tuple type with a string followed by a number?
13. Which feature allows you to create a type that depends on another type?
14. What are the differences between 'type' and 'interface' in TypeScript? (Select all that apply)
15. Type assertions (as) change the runtime type of a value.
16. Which of the following are valid uses of tuple types? (Select all that apply)
17. What is the purpose of a type guard function?
18. Decorators are a stage 3 proposal and require experimental flags in TypeScript.
19. What does the 'Record<K, T>' utility type create?
20. Name the utility type that excludes types from a union that are assignable to another type.
Answered 0 of 0 — 0 correct