How to Create NPM Package
Complete guide to publishing NPM Libraries with React JavaScript
Learn moreA comment tells browsers to ignore a piece of code.
Developers typically use comments for notes, debugging, and code deactivation.
Let’s see how commenting works in HTML, CSS, and JavaScript.
We use a <!-- -->
pattern to create an HTML comment. Here is the syntax:
Here’s an example:
You can also comment out multiple lines like so:
We use a /* */
pattern to create a CSS comment. Here is the syntax:
Here’s an example:
There are two patterns for commenting in JavaScript.
//
(Two slashes)/* */
(Two slashes and asterisks)We use the /* */
pattern to comment out one or multi-lines. But //
works for only single line commenting.
Here’s an example:
The keyboard shortcut to add comments in HTML, CSS, and JavaScript is: