Coding

JavaScript Comments – JavaScript Tutorial

Task

How to Declare JavaScript Comments

Description

All JavaScript statements are not “executed”.
Code after double slashes // or the code between /* and */ is treated as a comment.
Comments are ignored and will not be executed its only for programmer helps:

Example

<p id="demo"></p>
<script>
var x;
x = 15;
// x = 16; This line will not be executed
/* y = 26; This line will not be executed */
document.getElementById("demo").innerHTML = x;
</script>
Try It Yourself - Online Compliler >>