Tips n Tracks

  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • black color

Reference

Sample image

Microsoft .NET Framework Get Details.

Sample image

Microsoft .NET Framework Get Details.

Reference

Sample image Microsoft .NET Framework Get Details.
Sample image

Microsoft .NET Framework Get Details.


Learning JavaScript tutorial – JavaScript Comments


Learning JavaScript tutorial – JavaScript Comments

JavaScript Comments allows us to add remarks and a well written explanation about the working of JavaScript code. JavaScript Comments make the code more readable, understandable for future reference. Commenting your JavaScript code makes it easier for others to understand. To increase re-usability of a JavaScript code be, sure to include comments in your scripts. Commenting your JavaScript code is the best practice of JavaScript programming and suits to your aspect of good programming style.

Any comments you include in your JavaScript code will simply ignored by the JavaScript interpreter. JavaScript supports both C++ and C-style comments. JavaScript supports two types of comments, Single-line comments and multiple-line comments.

JavaScript Single line Comments

JavaScript Single line comments start with double Forward Slash (or Foreslash). Single-line comments which begin with double forward slash (//), causing the interpreter to ignore everything from the appearance point of double forward slash (//) to the end of the line.

// This is a single-line comment.
var iCount = 5;    // This line will ignore by JavaScript interpreter

JavaScript Multiple line Comments

Along with Single line Comments, JavaScript allows us to Comment Multiple line. Every line of code between /* and */ is treat as a comment and ignored by the JavaScript interpreter.

<script type="text/javascript">
/*
   This is our JavaScript Multiple line Comments
   you can use this comment block as per your requirement!
*/

for (x=0; x < 10; x++)
{
  document.write("x="+ x +"<br />");
}
</script>

JavaScript do not support nested comment block, so do not try this. Doing so may result in an error in code.

 

Chetan love blogging. He regularly blogs at http://www.tipsntracks.com. You can connect with Chetan on Twitter, Facebook and Google Plus...

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

Thnx! perfect

Comment by Dharmendra Barfa on April 9, 2010 @ 8:46 pm

Thanks you very nice yes yes

Comment by usevvv on November 30, 2010 @ 9:44 am

Leave a comment

(required)

(required)

*
To prove that you're not a bot, enter this code
Anti-Spam Image