Comments can be used to make the code more readable.
Single line comments start with //.
<script type=”text/javascript”>
// This will write a header:
document.write(”<h1>This is a header</h1>”);
// This will write two paragraphs:
</script>
Multi line comments start with /* and end with */.
<script type=”text/javascript”>
/* The code below will write one
header and two paragraphs */
document.write(”<h1>This is a header</h1>”);
</script>
Comment can also be used for hiding scripts.
<script type=”text/javascript”>
/*
document.write(”<h1>This is a header</h1>”);
*/
</script>
