Changes

Jump to: navigation, search

Comments in JavaScript

6 bytes added, 19:57, 27 October 2016
m
Text replacement - "<table border="0" cellspacing="0">" to "<table border="0" cellspacing="0" width="100%">"
<googlehtmlet>BUY_JAVASCRIPTjscript</googlehtmlet>
== Single Line Comments ==
The mechanism for a single line comment borrows from the C++ and Java languages by prefixed prefixing the line with //. For example:
<pre>
</pre>
The // syntax tells the interpreter that everything on the same line following on from the // is a comment and should be ignored. This means that anything on the line before the // comment marker it is ''not'' ignored. The advantage of this is that it enables comments to be placed at the end of a line of scripting. For example:
<pre>
var myString = "My lucky number is ";
document.writeln ( mayString myString + myValue );
*/
</pre>
<googlehtmlet>ADSDAQBOX_FLOWadsdaqbox_flow</googlehtmlet>
In the above example everything between the /* and */ markers is considered to be a comment. Even though this content contains valid JavaScript it is ignored by the interpreter.
<googlehtmlet>BUY_JAVASCRIPT_BOTTOMjscript</googlehtmlet>
 
<htmlet>ezoicbottom</htmlet>
<hr>
<table border="0" cellspacing="0" width="100%">

Navigation menu