The best way to avoid errors in scripts is to use a text editor without any margins, allow each line of JavaScript to stay on its own line, and not break long lines into two lines. There are two types of error messages:
I truncated the second line of the example script below to make it two lines. The browser displayed absolutely nothing at all, even though the first and third lines are correct. The error of the second line stopped the script entirely!
In 1999, I would have received error message alert windows about this, but not nowadays. Browsers have Developer's Tools, so I looked at the Console section of each. Internet Explorer had nothing at all about errors (at least I couldn't find anything). Both Google Chrome and Mozilla Firefox indicated a syntax error on line 72. Chrome reported "Uncaught SyntaxError: Unexpected token ILLEGAL" with a link to basic5.html:72 while Firefox reported "SyntaxError: unterminated string literal" with a link to basic5.html:72:16. The space before the first double quotation mark is the 16th character on the second script line. Now, that is precise!