TypeScript вопросы и ответы для интервью
Связанные сравнения
Вопрос 16. How do you use optional parameters in TypeScript?
Optional parameters in TypeScript are denoted by adding a '?' after the parameter name in the function declaration.
Вопрос 17. What is the purpose of the 'never' type in TypeScript?
The 'never' type in TypeScript represents values that never occur, such as functions that always throw exceptions or never return.
Вопрос 18. How does TypeScript achieve type inference?
TypeScript uses a mechanism called type inference to automatically determine and assign types to variables based on their values and usage.
Вопрос 19. What is the 'readonly' modifier in TypeScript?
The 'readonly' modifier in TypeScript is used to make properties of an object immutable after their initial assignment.
Вопрос 20. Explain the concept of union types in TypeScript.
Union types in TypeScript allow a variable to hold values of multiple types, separated by the '|' symbol.
Самое полезное по оценкам пользователей:
- What is TypeScript?
- Explain the difference between 'let' and 'const' in TypeScript.
- What are the basic data types in TypeScript?
- How do you define an interface in TypeScript?
- What is the 'any' type in TypeScript?