Question - How are comments used in JavaScript?
Answer -
JavaScript supports two types of comment insertion in the code. Single-line comments and multi-line comments.
Single-line comment: “//” is used for single-line comment insertion
Example:
//This is a single-line comment
Multi-line comment: “/* */” is used to add multi-line comments
Example:
/* This
is a
multi-line
comment*/