November 22, 2024

JavaScript Basic Concepts

JavaScript Comment

The javascript comments are a meaningful way to deliver messages. It is used to add information about the code, warnings, or suggestions. so that the end user can easily interpret the code.
The Javascript comment is ignored by the javascript engine i.e. embedded in the browser.

Types of javascript comments

  • Single-line comment
  • Multi-line Comment

Javascript single-line comment

It is represented by double forward slashes(//). It can be used before and after the statement.
<script>
//it is a single-line comment document.write(“hello javascript”);
</script>

Javascript Multi-line comment

It can be used to add single as well as multi-line comments. so, it is more convenient.

/*your code here*/

Leave a Reply

Your email address will not be published. Required fields are marked *