|
|
Javascript language | |   |
JavaScript is made of comments and instructions associated together. An instruction can include standard or user-defined functions, variables, datas (strings, numbers, ...) , and expressions. Comments It's ALWAYS necessary to comment your code, at least to could read it again after 6 months...
Comments begins by /* and ends by */, like this: /* After the tenth rewriting, a well-commented code is always better! */ Instructions Instructions include one or several elements and symbols on a line ended by ';', used as ending charachter. aText = "Hello!"; var myVar = 2 + 2; Blocks An instructions group inside {} is called a block. Blocks are used in functions definition and in conditionnal expressions. function SayHelloTo(MrSmith) { Alert("Hello, " + MrSmith); }
| |   |
|