How to find JS errors
var player = false; document.write("Type of Is Game", players);
In the above code, we have a “player” variable, but we trying to print the “players” variable. Only the player variable is here, there is no player variable. It is an error because we print without initializing the variable. Since we have written only two lines of code here, we can find it easily, if there are many lines of code, we will not be able to find it.
1. To find the error first, we go to the output page of the browser.
2. Right-click on it, and select “inspect” as in the below image.