Multiple choice technology programming languages

3) To comment out a line in JavaScript ...

  1. Precede it with two forward slashes, i.e. '//'

  2. Precede it with an asterisk and a forward slash, i.e. '*/'

  3. Precede it with an asterisk, i.e. '*'

  4. Precede it with a forward slash and an asterisk, i.e. '/*'

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Single-line comments in JavaScript use // at the beginning of the line. Option D shows the opening of multi-line comments (/), Option B shows the closing of multi-line comments (/), and Option C shows just an asterisk used for other purposes.