Skip navigation

You can comment in two ways in JavaScript code.

1) First one is to comment single line. For that we use two front slashes like //. Then the entire line will be considered as comment

Example

// This is a comment in JavaScript code

2) Second one is to comment multiple lines. For that we use start with /* and end with */
Example

/* This is the multi line
comment is JavaScript code */

So, where is the shock???

When you are using regular expression, be careful because you may encounter error.

/*
var reg = /a*/.match(str);
*/

So even when using comments, you should be careful…

Hope this will help…

Advertisements

One Comment

  1. You should have also posted proper way of handling JavaScript comments. This is how I do it.

    Thanks for mentioning to me that my name is there on the release notes. I did not notice until you mentioned that to me.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: