Net-informations.com
SiteMap  | About    

JavaScript Comments

Comments are annotations in the source code of a program that are ignored by compilers or interpreters, and therefore have no effect on the actual output of the code. Usually, comments are used to add information about the code, warnings or suggestions so that end user can easily interpret the code. They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters.

There are two types of comments in JavaScript:

  1. Single-line Comment
  2. Multi-line Comment

Single-line Comment

To create a single line comment in JavaScript, you place two slashes "//" in front of the code or text you wish to have the JavaScript interpreter ignore.

example

Multi-line Comment

Multi-line Comment or Block Comment is represented by forward slash with asterisk ( /*) then asterisk with forward slash(*/).

example









net-informations.com (C) 2018    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.