How do we use single line comments in JavaScript?

JavascriptWeb DevelopmentFront End Technology

The following is a single line comment in JavaScript. Any text between a // and the end of a line is treated as a comment and is ignored by JavaScript.

// This is a comment. It is similar to comments in C++

The following example showing how to use single line comments in JavaScript.

<script>
   <!--
      // This is a comment. It is similar to comments in C++
   //-->
</script>
raja
Published on 09-Jan-2018 09:35:21
Advertisements