Using the JavaScript Console

The console reads the JavaScript code, evaluates it and prints out the result of the expression. It can be used also as a debugging tool for the code in a program. We use the console.log() function to display information on the console.

Where can you find the new JavaScript console? Here is a step by step guide on how you can find and use the JavaScript console on BSD Online.

When you open a sandbox, by default you will see the output of what you have coded.

Step 1: Click the “>_” button to switch to the console.

Step 2: You should now see the console.

Step 3: There are two ways to clear information in the console.

3a) By clicking the “clear” button on the console.

3b) Type the function console.clear();

To learn more about JavaScript, here’s the cheat sheet for you.