Chapter 7 Errors and Debugging

A truth that many JavaScript books won’t tell you is that JavaScript is a tough language to get right the first time.

By now you should have a fairly solid feel for JavaScript as a language, and how to use things like event listeners and the DOM API to enrich the web sites you build. But if you’ve actually tried to write an original script of your own, chances are that you came away feeling humbled, and maybe even a little angry.

That frustration’s probably due, in part at least, to the fact that JavaScript, like all languages that run in the browser, is designed to fail silently by default. When things go wrong in the code you write, there’s no point in shouting about it to your hapless visitors, so browsers ...

Get Simply JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.