Debugging
Common JavaScript Errors
Here are some common errors people make in JavaScript.
Finding JavaScript bugs
Learn:
- Syntax bugs happen when you type something the browser doesn’t understand, like
alrt().
- Use Firefox’s error console to track down syntax errors.
- Logic errors are when you tell the browser to do the wrong thing.
- Use
alert()statements to track program execution. Ifalertmessages are supposed to show up, but don’t, you know what code is not executing.
- Use
alert()statements to look at the values of variables.