elibraryportal Logo

Js Comments

Mainly JavaScript comments can be used to explain the JavaScript code .

Types of JS

There is two types of Js Comments that is.

  1. Single Line Comments
  2. Multi-line Comments

1) Single Line Comments in Javascript

Use the double forward slash // for single line comments.

Syntax:

Example:

Test it Now

2) Multi-line comment in Javascript

A multi-line comment in javascript start with forward slash and asterisk (/*), and end with the reverse asterisk and forward slash (*/).

Syntax:

Example:

Test it Now
Next TopicJS Variable