javascript-comment

JavaScript Comments

There are two types of javascript comments.

  1. Single line comment
  2. Multi line comment

JavaScript Single line Comment

Javascript single-line comment can be done by double forward slashes (//). Javascript can not execute the text that is lies between (//) and the end of the line.

Let us add a single-line comment for the developer's hint.

Source Code

Try it yourself

Disabling Javascript Source Code

Let us add a single-line comment for disabling the Javascript statement.

Source Code

Try it yourself

Javascript Multi Line Comment

Multi-line comment starts with /* and ends with*/. It is used to add a single line as well multi-line comment.

Multi-line comment is used to provide the developer's code hint:

Source Code

Try it yourself

Disabling Source Code Using Multi Line

Multi-line comment is also used for disabling unnecessary sources of code.

Source Code

Try it yourself