Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (7 sloc) 520 Bytes

Comment your JavaScript Code

Comments are a great way to leave notes to yourself and to other people who will later need to figure out what it does. Any code in it will be ignored.

Let's take a look at the two ways you can write comments in JavaScript.

  • The double-slash comment will comment out the remainder of the text on the current line:

// This is a comment.

  • The slash-star-star-slash comment will comment out everything between the /* and the */ characters:

/* This is also a comment */

Something went wrong with that request. Please try again.