Common Errors

What follows are examples of the most common errors that newcomers to JavaScript make. They are presented to you so you will be aware of these kinds of errors and can avoid them as you write your code. They aren't presented in any sort of technical order and aren't a complete list by far, but if you can learn to identify these, your JavaScript projects will have a much better chance of working the first time.

Typos and Spellos!

Most of the errors you'll encounter when writing JavaScript (if you follow the examples laid down here) will probably fall into these categories. Typos occur when you accidentally hit the wrong key or combination of keys while typing. Examples of typos are such things as

  • Pressing the wrong key:

     <html> <head> ...

Get JavaScript™ 1.5 by Example 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.