NIELIT O Level Exam

How do you write a comment in JavaScript?

How do you write a comment in JavaScript?

जावास्क्रिप्ट में कमेंट कैसे लिखेंगे

A. //This is a comment

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

C. /* This is a comment */ /*This is a comment*/

D. Both A and C




Correct Answer is :

D. Both A and C



Explanation


In JavaScript, you can write comments using two different syntaxes:

  • Single-line comments : // use for single line comment
  • Multi-line comments: Use /* to begin a multi-line comment, and */ to end it. 
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad