TypeScript Flashcards
1
Q
What is TypeScript
A
Superset of JS/ does everything JS does but has some added features
All about TypeSafety
2
Q
Advantages of using TS?
A
Static typing meaning type of variable cannot be changed or reassigned
This is to prevent a lot of bugs
If declared a string cannot be changed to integer
Less bugs
More precise, readable code
Shows errors as you write
Less error in runtime
3
Q
Disadvantage of TS?
A
Cannot be read by browser requires a compiler to compile into JS
Compiler is TSC
4
Q
Primitive vs reference types
A
Primitive take up a unique location in memory
Reference type refer to a memory location