Almost every line of JavaScript code you will write will be a statement. Individual statements are what give a whole script structure and direction.

What statements do pretty much sums up what scripting is all about. Statements declare and initialize variables, invoke methods and functions, change or assign values to objects and properties and make decisions.

Ending A Statement

A statement's end is signified by a semicolon (;). Placing a semicolon at the end of a statement not only makes your script readable to you, it also tells the JavaScript interpreter that the statement has ended. Unlike other languages, a carriage return may be used in place of a semicolon (I tend to leave them off). Multiple statements may be placed on a single line as long as they are separated by semicolons.

We'll cover individual statements in depth throughout these lessons, but you can take a sneak peak here at Netscape Devedge.

>>Objects, Properties and Methods
>>The Dot Syntax
>>Dot Syntax Alternatives
>>JavaScript Statements
>>JavaScript Placement: Script Tags and Source Files
>>JavaScript Placement: Event Handlers


View Source | Home | Contact