Which one of these look better?
this?π
function printHello() {
console.log("Hello"); // prints hello to the console..
}
or this..π
function printHello() {
console.log("Hello"); // prints hello to the console..
}
That's right! The code snippet with colors definitely looks better and there are many advantages of using this feature built into text editors.
This feature that enables us to add colors to our code is known as syntax highlighting and it makes it easier and more enjoyable to read and understand code.
How to add syntax hightlighting in markdown
This is actually very easy to implement. All you have to do is add the name of the the programming language after the backticks in your markdown editor.
like thisπ
```javascript function printHello() { console.log("Hello"); // prints hello to the console.. } ```
and viola! You're done!!
Make the world beautiful today by adding some color to itπ
Happy New Year Codersπππ..
Top comments (3)
Thanks. That was very useful.
Thanks Jima!! That is going to be really helpful
I'm glad you found it useful. Thanks for reading!