TypeScript cross interview #3
- What is the main difference between TypeScript and JavaScript?
- What advantages does TypeScript provide in large projects?
- What are the
primitive types in TypeScript?
- How do you define and use
enums in TypeScript?
- What is
structural typing and how does it differ from nominal typing in TypeScript?
- How do you declare a
union type in TypeScript?
- How do you use
union and intersection types? What is the difference between them?
- How can you compose
multiple types into one in TypeScript?
- What does the
Partial<T> utility type do?
- What is the difference between
Required<T> and Readonly<T>?
- What is the difference between
Omit<T, K> and Pick<T, K>?
- How do you use the
keyof operator in TypeScript?
- What is the
typeof operator used for in TypeScript?
- How do
conditional types work in TypeScript?
- What is a
template literal type and how is it used?
- How does the
infer keyword work in conditional types?
- What is
mapped types and how do you create one?
- What is a
named tuple in TypeScript and how it differs from array that holds multiple types?
- What is the difference between an
object type and a Record type?
- What does the
as const assertion do in TypeScript and when is it useful?
- How do you implement
function overloads in TypeScript?
- What are
generics in TypeScript and how do you use them in functions?
- How do you define and use
abstract classes in TypeScript?
- What are
access modifiers in TypeScript and how do they affect class members?
- What are the main differences between
interface and type in TypeScript?
- What is the difference between
never and void?
- Can you
inherit from multiple types in TypeScript? How is it done?
- How do you create a
type excluding some properties from another type?
- How do you specify a variable number of arguments in a function with types?
- What are
Type Guards and how do they help when working with different types?