Merge pull request #64 from earldouglas/side-effects

Expand side effects to include reading external mutable state
This commit is contained in:
hemanth.hm 2016-07-25 10:16:50 +05:30 committed by GitHub
commit f90841a2d7

View file

@ -154,7 +154,11 @@ greet(); // "Hi, Brianne"
## Side effects
A function or expression is said to have a side effect if apart from returning a value, it modifies some state or has an observable interaction with external functions.
A function or expression is said to have a side effect if apart from returning a value, it interacts with (reads from or writes to) external mutable state.
```js
var differentEveryTime = new Date();
```
```js
console.log("IO is a side effect!");