Multiple choice technology web technology

8.How can you add a comment in a JavaScript?

  1. 'This is a comment

  2. <!--This is a comment-->

  3. //This is a comment

  4. "This is a comment

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

In JavaScript, single-line comments are designated using double slashes at the beginning of the comment. HTML comment tags are used in HTML files, not inside JavaScript script blocks.