0Pricing
TypeScript Academy · Lesson

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

  1. JavaScript Pain Points: Runtime Bugs
  2. What TypeScript Adds to JavaScript
  3. Compiling TypeScript to JavaScript
  4. When to Use TypeScript in Your Projects
← Back to TypeScript Academy