It is represented by double forward slashes (//). It can be used before and after the statement.
Single-line comment added after the statement.
<script> var a=20; var b=30; var x=a+b;//It adds values of a and b variable document.write(x);//prints sum of 20 and 30 </script>
It can be used to add single as well as multi line comments. So, it is more convenient.
/* your code here */
It can be used before, after and middle of the statement.
Using comments to prevent execution of code, are suitable for code testing.
Adding // in front of a code line changes the code lines from an executable line to a comment.