DEV Community

stalin s
stalin s

Posted on

Commenting in javaScript.

We can write additional notes to help to think through problems in JavaScript . To write additional notes, you use comments.

Comments appear in** two **forms:

//
/* */

Commenting with //

You can write comments in JavaScript by adding double slashes (//). Anything after // is commented and will not be run by JavaScript.

` // comments in javascript.`
Enter fullscreen mode Exit fullscreen mode

Sample Example :
console.log("Hi folks") // printing hi folks

Commenting with /* /
You can also write comments with the /
/ syntax. Any words between / and */ is a comment.

/* comment in other way that lets user to add more text */
You can write comments that span multiple lines if you use /* */:

/*
all
lines
commented
in
this
example.
*/

Happy Learning

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay