Comments Flashcards

1
Q

Why use Comments?

A

to explain JavaScript code
easier to read
used to prevent execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does a Single Line Comments started with?

A

//

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Any text between // and the end of the line

A

will be ignored by JavaScript (will not be executed)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does Multi-line Comments started with?

A

start with /* and end with */

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Will the multi-line comment show within the HTML page?

A

No, the comment lines will be ignored.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can you Prevent Execution by using a comment lines?

A

Adding // in front of a code line changes the code lines from an executable line to a comment
This is great for code testing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly