7 Comments in Javascript – JS for Beginners

Last updated on October 31st, 2020 at 06:33 am.

7 Comments in JS - JavaScript Tutorial 2018

This video is taken from the full course that will teach you HTML, CSS, Programming concepts and Javascript .

Video Transcript:

Hi.

Okay, so like any other programming language, you’ll find yourself using comments in JavaScript.

And there are single-line and block comments.

So a single-line is just two forward slashes.

And then for a block comment, it is one single forward slash, an asterisk and an asterix and a forward slash.

So if I want to add a comment here, I can just add it there with forward slash there.

That’s a comment.

That’s a single-line comment.

And this will not be executed.

It is just a comment that will let someone else reading the code know what’s happening.

So that’s a single-line comment.

You can also have, you can also have the block comment.

So there.

So comments are useful.

They can help you understand what it is that you’re doing, especially when you’re writing lots and lots of code.

You can use comments to explain what you’re doing so that when you come back to the code in future, you will know what it is you were trying to do.

Because in most cases, you’ll find you write a lot of code and if you write a lot of it and there’s no way for you to remember what it is you were trying to do, you’ll have a hard time trying to figure out what exactly that code does.

So you can use comments, by single lines or you can use a block comment such as this one.

Let’s continue in the next video.

This section is from Learn Javascript from Scratch.

Learn Javascript from Scratch

Comment Here

Need WordPress help? Linux Server help? Talk to us.

  • We are your own WordPress customer service.
  • We set up Linux servers and install or migrate WordPress. Learn more here.
  • We support WooCommerce too.
  • Check out our WordPress customer support plans here or contact us below .

If you have any questions regarding WordPress support, Linux server support or any of our services, feel free to reach out or read more on our services page.

Join this free course:

How to host multiple WordPress
websites on a VPS

Close me!