bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/JavaScript/Debugging, Projects, and Reference
JavaScript•Debugging, Projects, and Reference

JavaScript Silent Errors

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind JavaScript Silent Errors?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___ x = 1 / 0;
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The reason for silent errors is historical:
A silent error will not stop your program.
JavaScript can fail siently.

Silent Errors

JavaScript can fail siently.

A silent error will not stop your program. The execution will continue.

The reason for silent errors is historical:

The first version of JavaScript did not have catch...try exceptions.

Silent errors are issues that do not throw exceptions or stop execution, but still cause logic bugs, unexpected behavior, or failures that are easy to miss.

Below are some examples of common silent errors, with examples to try:

Example

let x = 1 / 0;

Example

let result = "Not Active.";
let isActive = false;
// ❌ Assignment, not comparison
if (isActive = true) {
  let result = "Active!";
}

Explanation

The (isActive = true) assigns true to isActive, instead of checking equality with (isActive == true).

The next line runs silently and prints "Active!", even though isActive is false.

Example

// NaN - no error, just wrong data
const result = parseInt("abc");

Example

const user = {};
let result = user.name;

Example

let result1 = ('5' + '2');
let result2 = ('5' - '2');

See Also

JavaScript Errors

JavaScript Error Statemets

JavaScript Error Object

JavaScript Debugging

Previous

ECMAScript 2026

Next

JavaScript Debugging Console