Day 9— Console

What I learned from JavaScript 30(Course Web —

Besides console.log(), there are many other console things could be used to debug.

Here’s a list on MDN:

En-MDN: Console

As well as some examples from this course, Coding on Github .

I list here what I feel the most useful:


The most useful one. It’s good to know that there are three different console.log().

Regular one


String parameter one

console.log(‘Hello %s’,’world’)

%s will be replace by second parameter.

Styled one

console.log(‘%c Watch out!’, ‘font-size:40px; color:red’)

%c must be at the beginning of first parameter. You will get a big red ‘Watch out’ text in consoler.


This will return the data in a form of table. It’s the most efficient way to check the array that including objects.


console.time(‘fetching data’);
 .then(data => data.json())
 .then(data => {
 console.timeEnd(‘fetching data’);

Sometimes we need to consider timing efficiency of our codes, console.time() will help.


It’s useful to test something without checking the ‘Elements’, though the latter way is easier and faster.