Projects > JS Console

Home Projects Challenges

JS Console


June 09, 2021 | Vanilla JS

Day 9 Challenge of 30 day JS, implementing JS Console.

Console Trick

Interpolated console

console.log("You are %s", 'great!');

Console with CSS style

console.log('%c how are you doing', 'color: green; font-size: 20px;');

Console Assert for testing

console.assert(Condition, console when is not true);

Console Dir (Viewing DOM element)

console.dir(document.querySelector('p'));

Console Group for grouping log

console.group('name of group');
// All the console messages
console.groupEnd('name of group')

Console Count

console.count('variable');
// variable: count

Console Timing for measuring the time used

console.time('name of measurement');
// All the operation
console.timeEnd('name of measurement')
// name of measurement : time in ms

Clear all the console

console.clear();

Other console

console.info('info')
console.warn('warning');
console.error('error');
console.table([{}, {}]);

↤ Go Back

Updated in June 09, 2021
Gmail | Proton | LinkedIn | Github
Alright reserved 2021