JavaScript comments

Lesson 2: JavaScript comments

 Comments are important part of any programming or scripting language.

JavaScript supports comments. Comments are lines of code that are ignored by JavaScript.

These are really helpful for documentation. In simpler terms they are a way to leave notes for others who are reading your code.

There are two types of comments.

  • Single line
  • Multiline

Single line comments occupy just a line of code.

//This is a comment

Multi line comments occupy more than one line of code.


This is 


a comment that spreads over multiple lines.


Post a Comment