Advanced console.log Tricks You May Not Know

Alex Carter
3 min readApr 2, 2024

Find the Console Tool

To access the Developer Tools interface, open your preferred browser and press F12 on your keyboard (or, if you’re using a Mac, press fn + F12). This will open the interface, where you can locate the Console tab and begin using it.

Apply multiple CSS styles

In this example, the first %c directive applies the "color: red" style to the text "red", and the second %c directive applies the "color: orange" style to the text "orange". The additional unformatted message is displayed without any specific CSS style.

console.log(
"Multiple style: %cred %corange",
"color: red",
"color: orange",
"Additional unformatted message"
);

Print ASCII Art

Try using online tool like ASCII Art Archive to convert text into ASCII art.

--

--