Multi-line Comments

A multiline comment in JavaScript is a way to include comments that span multiple lines in the source code.

Syntax:

/*    
This is a multiline comment   
It can span multiple lines    
*/

Example: This example illustrates the multi-line comment using /* … */ 

Javascript
/* It is multi line comment.  
It will not be displayed upon 
execution of this code */  

console.log("Multiline comment in javascript");  

Output
Multiline comment in javascript

JavaScript Comments

JavaScript comments help explain code, making it easier to understand. You can also use them to temporarily disable parts of your code. The JavaScript compiler ignores comments when running the code.

Similar Reads

1. Single Line Comments

A single-line comment in JavaScript is denoted by two forward slashes (//),...

2. Multi-line Comments

A multiline comment in JavaScript is a way to include comments that span multiple lines in the source code....

JavaScript Comments to Prevent Execution

We can use // or /*…*/ to change the JavaScript code execution using comments. JavaScript Comments are used to prevent code execution and are considered suitable for testing the code....

Contact Us