JavaScript Comments

DevJunctionPoint
0

 JavaScript Comments

  • JavaScript comments are hints that a programmer can add to make their code easier to read and understand. 
  • They are completely ignored by JavaScript engines.

There are two ways to add comments to code:

  • // - Single Line Comments
  • /* */ -Multi-line Comments

Single Line Comments

  • In JavaScript, any line that starts with // is a single-line comment.


    let firstName = "ram";

    // printing name on the console
    console.log("Hello " + firstName);

Multi-line Comments

  • In Javascript, any text between /* and */ is a multi-line comment


    /* The following program contains the source code for
    For the they cannot move. The player controlling the his disposal.
    */

Tags

Post a Comment

0Comments

Do leave your comments

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Ok, Go it!
To Top