Does it mean, exclusively, that a variable is being written?
This isn't a formally defined term in JavaScript, but I see it most commonly used to refer to some change in state outside of the immediate context. For example, the following code will cause no changes in state after execution, so it would be considered "side-effect free":
(function() {
// no side-effects, foo won't exist once this function is done executing
var foo = 'bar';
})();
... whereas in the following code there are side-effects, because a global variable is introduced:
(function() {
// no var keyword, so global variable created
foo = 'bar';
})();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With