A runtime error occurs while JavaScript is executing, after compilation. TypeScript can catch some conditions earlier by checking declared types, but it compiles to JavaScript and does not change JavaScript’s runtime behavior. section 3.4.2
Rejecting an invalid argument at runtime
A JavaScript function adds 100 to its argument. Passing 1 produces 101, while passing "London" produces London100 unless the function checks the value. With a runtime check, the second call throws "Expected a number: London". A TypeScript number annotation moves this mismatch to compilation, where the compiler reports that string is not assignable to number. section 3.4.2
My result: 101
C:\example.js:6
throw ("Expected a number: " + param)
^
Expected a number: London
(Use `node --trace-uncaught ...` to show where the exception was thrown)
Inspect the thrown exception and Node.js output produced when the function receives an unexpected string. section 3.4.2
