When running Javascript, one will normally encounter problems such as getting an error message or the script running but not what you intended it to do. The first thing you can do is to go back to your code to trace for errors.
Javascript error 1: Mismatched braces
Javascript commands are run as a block, which is why in Javascript programming the commands are kept in braces. For every { brace used, there should be a } brace. Additionally, in programming, you will have statements and loops that are nested within one another. This leads to confusion or difficulty in tracking the { braces that will need the corresponding } braces, especially if several blocks end at the same time.
Javascript programming error 2: Mismatched quotes or apostrophes
The usual programmer oversight is when a closing apostrophe is left out or an open quote lacks the corresponding closing quote. Another possible cause for error is when the text contains an actual apostrophe and you forgot to escape it with a backslash. Without the escape, the apostrophe will be treated as the end of the text instead of being within it.
Javascript language error 3: Missing semi-colon
There is also the common Javascript error of the missing semi-colon. This is a syntax error wherein the programmer forgets to put a semi-colon at the end of each statement.