|
Even though JavaScript is fairly readable
for a programming language, it certainly isn't English and
therefore can become quite confusing. Moreover, it's easy
to use complicated logic in a program that might not be readily
apparent the first time someone else reads the code to your program.
If you just need to add a small amount of
description to the code you are writing, a single-line comment
is probably the best option. Placing two slashes (//) before
your text makes it into a single line comment.
Example :
document.write("You
have been introduced to JavaScript ");
Sometimes one line of commenting isn't enough
room for the description you want to provide. In this case,
you can use a multiline comment. Multiline comments are specified
by surrounding the commented text with " /* " at
the beginning and " */ " at the end.
Example :
Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.
|
|