Lesson 02
Why mistakes slip through
JavaScript is wonderfully flexible about the values it holds — and that flexibility is exactly how bugs sneak in.
PLAINA box that holds a value (a variable) will accept any kind of thing — a number, some text, a yes/no — and JavaScript never checks whether it's the kind you meant. The number
5 and the text "5" look identical but behave differently: 5 + 3 is 8, while "5" + 3 is "53". JavaScript runs both without blinking.A LEVEL DEEPERBecause JavaScript only checks things while it runs, a slip stays invisible until that exact line executes — often later, on someone else's screen, far from where you made the mistake. That gap, “nobody checked what kind of value this is,” is the whole reason TypeScript exists.