JavaScript Pain Points: Runtime Bugs
Explore common JavaScript bugs that only appear at runtime.
Welcome
In this lesson we explore the runtime bugs that motivated TypeScript's creation. JavaScript is flexible — but that flexibility can cause hard-to-find errors.
The Silent Type Coercion Bug
JavaScript silently coerces types. Adding a number to a string returns a string, not an error. This causes unexpected behavior at runtime.
// JavaScript
let total = 5 + '10'; // '510' not 15
console.log(total); // '510'All lessons in this course
- JavaScript Pain Points: Runtime Bugs
- What TypeScript Adds to JavaScript
- Compiling TypeScript to JavaScript
- When to Use TypeScript in Your Projects