Skip to content
Intro to JS+prossecingJS
Share
Explore
Session 6

icon picker
Writing Clean Code

Comments

A comment is where human can read in code, you can use comment to represent what does a line of code do.
Do make a comment, you just need to type two slashes // and then boom! Your done. You can type any text in that line.
comments.gif

Readable Code

Here, we have a line of code below:
It looks messy, so let’s see how we can make it more readable. To do that, let’s give each statement it’s own line:
It looks cleaner, but we can make it more cleaner by indenting and giving white space to punctuation and letters:

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.