This are some alternatives to console.log():

console.dir()

For list arrays and objects:

console.dir(["apples", "oranges", "bananas"]);

console.dir() output

console.table()

Show arrays and object in a table:

console.table(["apples", "oranges", "bananas"]);

console.table() output

console.group()

Create groups for console log:

console.log('This is the top outer level');

console.group('Task 1');
console.log('Task activity 1');
console.log('Task activity 2');
console.groupEnd();

console.group('Task 2');
console.log('Task activity 3');
console.log('Task activity 4');
console.groupEnd();

console.log('Back to the top outer level');

console.group() output

console.time()

It starts a timer with the label given. When you call console.timeEnd() with the same label it will log the time elapsed since the timer was started.

console.time('example-1')
// Do stuff
console.timeEnd('example-1')

console.time() output

console.clear()

This will clear the console.

👉 Source

👉 More info