PDA

View Full Version : [SOLVED]Syntax help



vzhen
16 Sep 2009, 11:47 AM
Hi All,

I always confuse on syntax. Example which part have to use (), {} [] " " ' '.....etc and when have to stop with ; , ....etc.

Anyone has a very yvery simple but details reference?

Thank you

VinylFox
17 Sep 2009, 5:28 AM
JavaScript does not require semicolons at any particular place, as long as your using line feeds then a semicolon is assumed and the JavaScript engine in the browser will fix them at runtime.

However! I highly suggest that you DO use semicolons, for many reasons that we don't need to get into here, and a great way to figure out where they should be is to run your code through jslint - http://www.jslint.com/

carol.ext
17 Sep 2009, 7:45 AM
Douglas Crockford has some good information, including some of the videos:

http://javascript.crockford.com/

For a real quick intro:

http://javascript.crockford.com/survey.html



Hi All,

I always confuse on syntax. Example which part have to use (), {} [] " " ' '.....etc and when have to stop with ; , ....etc.

Anyone has a very yvery simple but details reference?

Thank you

vzhen
17 Sep 2009, 5:19 PM
Ok,

Thanks both of you