Side effect (Definition)

The changes to the execution environment due to some code being executed.

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