You can write additional notes to help you think through problems in JavaScript. To write these 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.
// This is a commentYou can write // comments anywhere in your code, even in the middle of a line, like this:
const tables = 4 // 4 tables in the roomFor the purpose of this course, whenever I console.log a variable from this point onwards, I would also write a comment that shows you what is printed in the console, like this:
console.log(44) // 44Commenting with /* */
You can also write comments with the /* */ syntax. Any words between /* and */ is a comment.
/* This is a comment */You can write comments that span multiple lines if you use /* */:
/* Everything is commented in this example.*/Welcome! Unfortunately, you don’t have access to this lesson. To get access, please purchase the course or enroll in Magical Dev School.
Unlock this lesson