Most (all?) browsers have developer tools including what is known as the console window. In Firefox running in Windows the key combination Shift-Ctrl-I will open the console at the bottom of the screen. In Microsoft Edge the same keys work but the console window is on the right. The most useful aspect of this for now is that if the browser detects an error it will report it in this window and give useful information such as the file and line number at which the error was detected. That means something was wrong somewhere in or before that line. It often enables you to fix the mistake.
The two browsers mentioned here also have menus in which the Console can be found under Developer Tools. Other browsers are likely to be similar.