JavaScript Console Pro tips

Simuratli
2 min readJul 13, 2022

--

  1. Console.log()

I think everyone uses that in daily life many times.

2. Console.error() — error message

If you want to display an error message in the console it will be helpful.

3. Console.warn() — warning message

The warning message will be highlighted in yellow color.

4. Console.clear() — clear all messages, errors, and warnings from the console.

5. console.time() and console.timeEnd() — calculate amount of spending time for code.

If you write codes between .time() and .timeEnd() you can calculate the amount of time spent by a block or a function.

Note: Labels should be same for .time() and timeEnd();

6. Console.table() — create table inside console for objects.

7. Console.count() — help to count items or our function render how many times.

8. Custom console.log() with styles.

You can add style next to the value which you want to log and it will be shown in the console.

--

--

Simuratli
Simuratli

Written by Simuratli

MSc. High Energy and Plasma Physics | B.A. Computer Engineering | Content Creator. https://bento.me/simuratli

No responses yet