User Program Communication

Commenting in JavaScript

Commenting is used to write text within the code that is ignored by the compiler.


Syntax
// A single line text comment
/* A block comment, 
containing multiple lines
 */ 

Notes

Can be used for documentation, code descriptons, resource inclusion, readability, debugging, and any other note that the programmer would like to include.

For the // comment, the compiler will ignore everything from // to the end of the line.
For the /* */ comment, the compiler will ignore anything from /* to */.


Example
/* This code is written by Anthony */ 
var result = 5 + 5; //the result should be 10

Add to Slack

< Console Output   |   Read from Text File >

© 2018 SyntaxDB. All Rights Reserved.