//
the double slash comments out anything after it, just on that one line
/* */
anything between the slash-star and star-slash is considered a comment. the star-slash can be on a subsequent line if desired.
Code:
<script type="text/javascript">
//<![CDATA[
a = 2; // comment goes here
// this is another comment
/* and this is yet
another comment */
b = 3;
document.write("a=", a, ", b=", b);
//]]>
</script>
Output: