JavaScript Comments
JavaScript Comment
JavaScript comments are any code after a double slash //, or between /* and */, which is treated as a comment, and will be ignored, and not executed. Comment's main purpose is to describe the functionality of a particular code,
Uses of JavaScript Comments:-
- helps in understanding code
- makes code more readable
- assist the developer to learn more about the functions that a certain code can perform
- can be used as notes
- it can be used to display updates or portrayals
Types of Comments:-
- Single Line Comments
- Multiline Comments
Syntax:-
The syntax for Single Line Comments:-
// This is a single-line comment
The syntax for Multiline Comments:-
/*
This is a multi-line comment
*/