JavaScript Tutorial




Lesson 8 - Errors




You must be knowing about bugs. No, i'm talking about the coding bugs. They are typos in code which can mess up the output. Even replacing an "e" with a "b" can change or even crash the output. So how to you keep a track of errors, and catch them when they happen?

The Console. If you do a CTRL + Shift + J combo on your keyboard, you will see the console. Its just a place to display error and log info. So, how to we do that?

We have 3 commands: console.log(), console.warn(), console.error(). Logs are displayed white, warns are yellow, and errors are red. You can log the console to check if stuff is working. EG: you can check if a program is running by doing a if loop, and logging the console "program on". or, you can error the console if the program is not working.

The console is a helpful tool for Javascript.


Open the console now to see examples of logs, errors and warns!


< Previous------------------------- Next >