Multiple choice technology web technology

What is the correct JavaScript syntax to insert a comment ?

  1. /This comment has more than one line/

  2. <//This comment has more than one line//

  3. <!--This comment has more than one line-->

  4. //This is a comment

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

JavaScript supports two types of comments: single-line comments starting with // and multi-line comments enclosed between /* and */. Option A demonstrates multi-line comment syntax, while option D shows single-line comment syntax. Option B uses incorrect angle brackets with the comment markers, and option C shows HTML-style comments which are not valid JavaScript comments.