Lesson 04
What TypeScript adds
TypeScript is JavaScript plus type labels that get checked as you write — so mix-ups get caught in your editor, not by your users.
PLAINYou add a small label saying what kind each box should hold —
age: number. The instant you try to put text in it, your editor underlines it in red, like spellcheck for code, and you fix it right there. Plain JavaScript would have shrugged and broken later, when it ran.HOW REACT FITS INThe labels exist only for checking — they don't change what the program does. React is a JavaScript library, so TypeScript layers on top of it the same way. Label a
likes count as a number, and setting likes = "four" gets caught before your interface shows nonsense. React gives you the reacting screen; TypeScript guards the data it reacts to.