30 Days Of JavaScript

Day 1: Simple Types

Lesson 7: Comments

Sometimes we want to leave notes in our code that we want JavaScript to ignore.

We can do that with two forward slashes //.

1// This is comment and will be ignored

This is a comment and the // tells JavaScript to ignore everything after it.

You can do multiline comments with /* to start and */ to end the comment

1/*
2This is a comment
3on two lines
4*/

and you can add the // type after a line of code, so like this:

1let myAge = "35"; // this is the users age

Outline

Go Pro?

If you upgraded to pro, sign in here

  • About
  • Blog
  • Privacy
Looking to email me? You can get me on my first name at allthecode.co