An empty statement is signified by a semi-colon on a line by itself or a semi-colon following a semi-colon with no executable statements in between them.
The associativity is left to right.
Refer to the operator precedence topic for details of execution order.
If you intentionally place an empty statement into your script, you should put a comment adjacent to it to make sure people realize you did it on purpose. They may remove it otherwise and you may have had a functional reason for putting it there such as to aid the parsing of the text inside a SCRIPT object.
This sails awfully close to the territory of self modifying code which programmers have always loved to do and preachers of good programming style have said is a very bad thing.
On the other hand, JavaScript supports the eval() function and you can't get closer to self modifying code than that.
See also: | Associativity, Operator Precedence, Semi-colon (;), Statement |
Prev | Home | Next |
Emboss() | Up | enableExternalCapture() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |