|
Unless you are familiar with programming, you have encountered a number of unfamiliar ideas and constructions as you’ve worked with JavaScript. Although this chapter cannot go into every possible detail, some of the aspects of JavaScript “grammar” you have used thus far are reviewed in the following table:
To Do This | Use This |
---|---|
Add a single-line comment to JavaScript | // Your comment goes here |
Add a multiple-line comment to JavaScript | /* Your comment goes here */ |
Hide JavaScript from HTML | <script> <!-- script goes here --> |
End a complete JavaScript statement | Use a semicolon (;) |
Use a method or function. The method or function’s arguments go inside parentheses (Arguments are the specific actions a method | method( ) function( ) |
Connect multiple JavaScript statements | Enclose in curly braces { } |
Connect (concatenate) groups of literal characters (strings) | Use the "plus sign" (concatenate operator) |
Say that something is “equal to” something else | Use double equal signs ( = = ) |
Assign a value to a variable (something that | Use a single equal sign ( = ) |
|