skip to content
Dev Journal

Comments

/ 1 min read

In JavaScript, you can use comments for additional notes. Comments are of two types:

  1. //
  2. /* */

Use double slashes (//) to comment. Everything after // won’t be executed by JavaScript.

// This is a comment

You can place // comments anywhere, even mid-line:

const tables = 4; // 4 Tables in the room

Comments using /* */ syntax encapsulate any text between /* and */ as a comment.

/* This is a comment */

Multi-line comments can be written using /* */.

/*
Everything is
commented in this
example.
*/