New: Intelligent Flashcards spaced-repetition decks for every topic, built to make things actually stick.
A plain JavaScript file calls your compiled saveAge(age: number) and passes the string "42". What does the number annotation do when that call runs?
saveAge(age: number)
"42"
number
It coerces the string into a number first, the way Number("42") would, so the body still sees 42.
Number("42")
It throws a TypeError as soon as the wrong value arrives, before your function body runs.
Nothing at all. It was erased during compilation.