+ 3

What is use of comment tag...if it is not displayed on webpage....plz explain

beginner

1st Mar 2018, 11:19 AM
Ram Adarsh Sundram
Ram Adarsh Sundram - avatar
4 Answers
+ 5
Comments are used for notes in the markup so that it will be easier to understand by other developers. Comments can also be used to temporarily remove a part of the code for testing purposes.
1st Mar 2018, 11:28 AM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
+ 3
To summarize what the code does. It also helps explain what is going on in the code when working in teams. Also to further intellisense information in some IDEs.
1st Mar 2018, 11:24 AM
Brandlarm
Brandlarm - avatar
+ 1
Comments are basically internal documentation. It allows you to explain how a chunk of your code works to yourself and others. In small projects it might not seem too important but in projects of larger scale it's a necessity to use comments to explain how your code works, why it works, what it's there for, etc.
2nd Mar 2018, 3:55 AM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar
+ 1
Comments are useful for various reasons such as: - They may explain what a particular function does - They may explain something which might not be obvious to the reader - They may clarify your intention behind a certain line or block of code - They may serve as a reminder to change something in the future. - They may be used to comment out code without completely removing it.
4th Apr 2018, 2:47 AM
Memphis Reigns
Memphis Reigns - avatar