Coding With Fun
Home Docker Django Node.js Articles FAQ

How does JavaScript add comments?

May 29, 2021 Article blog

Comments are important in project development, and reasonable code annotations facilitate later modification and maintenance of the project and make it easier for co-workers to understand the functionality of the piece of code. W hen the browser is running, the comments are not read. Today we're going to learn how JavaScript adds comments.

Single-line comment: In JavaScript, a single-line comment is represented by // (double forward slash). as follows:


Multi-line comments: Multi-line comments in JavaScript */ included in /* and /**/ slash with asterisk). as follows:


Or as follows:


That's all JavaScript says about how to add comments.