When functions are executed, they may alter some item in memory or cause some change to occur aside from simply returning a value. For example, a function may create an object and add it to a persistent array and return some value such as the number of elements in that array. The calling expression was not aware that the array was extended and simply received a numeric value as a result of evaluating the function. The side effect was that the array became longer by one element.
See also: | Expression, Script execution |
Prev | Home | Next |
.shtml | Up | Sidebar object |
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. |