- Forums
- Javascipt
- How To Put Comments In Javascript
This Page Will Show You How To Put Comments In Javascript Because Putting Comment In Your Javascript Code Scripts Is Easy Just Follow This Tutorial On How You Can Add Comments To Your Javascript Code [2201], Last Updated: Mon Jun 24, 2024
Webune Tutorials
Wed Dec 30, 2009
8 Comments
613 Visits
Welcome to Webune Web Hosting
We provide web hosting for all types of websites
today's questions is regarding a very important factor when coding your scripts in javascript or any other program language.
its comments
commments are extermely valueable for you and for other programmers, they are reminders of what the script is doing. this is specially important in areas of function. its always a good a idea to add your notes about what the function is expected to do
there are two way you can add comments
1. you can use the doubleslash way //
for example:
JAVSCRIPT COMMENTS:
// Hi I am putting comments using doulble slashes
[NOTE: with the doubles slashes, you are limited to putting comments to one line
2. the secod way is by using the astiric and a slash
JAVSCRIPT COMMENTS:
/* Hi i am puting comments using this tutorial
how i am puting more comments on the second line
and finaly, also on the third line i can go on as long as i dont close my comments with: */
llike put a pound sign like in php?
like this:
# hi these are my comments
does that work?