bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Learn/JavaScript/Debugging, Projects, and Reference
JavaScript•Debugging, Projects, and Reference

JavaScript Silent Errors

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

This chapter

Overview
32

Lessons

180m

Read time

1. JavaScript Errors2. JavaScript Debugging3. JavaScript Statements4. Project - localStorage Counter5. ECMAScript 20266. JavaScript Silent Errors7. JavaScript Debugging Console8. JavaScript Reserved Words9. Project - Event Listener10. ECMAScript 202511. JavaScript Error Statements12. JavaScript Debugging Breakpoints13. JavaScript Operator Precedence14. Project - To-Do List15. ECMAScript 202416. JavaScript Debugging Errors17. Project - Modal Popup18. ECMAScript 202319. JavaScript Debugging Async20. Project - Form Validation21. ECMAScript 202222. ECMAScript 202123. ECMAScript 202024. ECMAScript 201925. ECMAScript 201826. ECMAScript 201727. ECMAScript 201628. Javascript 2015 (ES6)29. JavaScript 2009 (ES5)30. JavaScript 1999 (ES3)31. JavaScript Versions32. JavaScript History

On this page

Silent ErrorsExplanation