How can you add a comment in a JavaScript?
-
<!--This is a comment-->
-
//This is a comment
-
'This is a comment
-
?this is a comment ?
B
Correct answer
Explanation
JavaScript uses double forward slashes (//) for single-line comments. Option A () is HTML comment syntax, not JavaScript. Options C and D are not valid comment syntax in any language.