Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

Basic JavaScript FCC barkinet

More than 3 years have passed since last update.

Menulearn to code javascript at Free Code Camp logo
Comment your JavaScript Code
Comments are lines of code that JavaScript will intentionally ignore. Comments are a great way to leave notes to yourself and to other people who will later need to figure out what that code does.

There are two ways to write comments in JavaScript:

Using // will tell JavaScript to ignore the remainder of the text on the current line:

// This is an in-line comment.
You can make a multi-line comment beginning with /* and ending with */:

/* This is a
multi-line comment */
Best Practice
As you write code, you should regularly add comments to clarify the function of parts of your code. Good commenting can help communicate the intent of your code—both for others and for your future self.

Try creating one of each type of comment.

Run tests (ctrl + enter)
Reset Help Bug
* Your output will go here.
* Any console.log() -type
* statements will appear in
* your browser's DevTools
* JavaScript console as well.

Create a // style comment that contains at least five letters.
Create a /* */ style comment that contains at least five letters.
Make sure that you close the comment with a */.


// This is an in-line comment.
/* This is a
multi-line comment */

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away