TypeScript Fundamentals

Assess your understanding of types,interfaces,and generics in TypeScript.

1. Which of the following is a primitive type in TypeScript?
2. Select all valid TypeScript types from the options below.
3. TypeScript is a superset of JavaScript.
4. What is the file extension for TypeScript files?
5. Which keyword declares a block-scoped variable that cannot be reassigned?
6. Which are valid ways to define a union type in TypeScript?
7. The 'any' type in TypeScript enables full type checking for that value.
8. What keyword creates a custom type alias?
9. What is the return type of a function with no return statement?
10. Which are built-in TypeScript utility types?
11. Interfaces can extend other interfaces using the 'extends' keyword.
12. What term describes a type that can hold a value or null/undefined?
13. Which correctly annotates a function taking a string and returning a number?
14. Differences between 'type' and 'interface' include:
15. The 'never' type represents values that never occur (e.g., a function that always throws).
16. What compiler option enables strict type-checking features like strictNullChecks?
17. What type is `const x: [string, number] = ['hi', 5];`?
18. Valid type assertion syntax in TypeScript:
19. TypeScript code runs directly in browsers without compilation.
20. Name TypeScript's built-in compiler (abbrev.)
Answered 0 of 0 — 0 correct