Javascript - Syntax : Comments Flashcards
What are comments in JavaScript used for?
To leave notes for other developers or ourselves that the computer will ignore during execution.
Comments can explain code functionality, provide instructions, or add annotations.
What is a Single Line Comment in JavaScript?
Represented by //; anything after // on the right of the same line is ignored by the computer.
It is used for brief comments on a single line.
What is a Multi Line Comment in JavaScript?
Represented by /* and */; anything between these symbols is ignored until the closing symbol is reached.
It allows for comments that span multiple lines.
True or False: If comment symbols are not correctly used, no code will be executed.
True
This applies to both single-line and multi-line comments.
Fill in the blank: Single Line Comments in JavaScript are represented by _______.
//
Fill in the blank: Multi Line Comments in JavaScript start with _______ and end with _______.
/*, */