From b0e8112cac7b5135b9b65a5b034d4d0096a39f12 Mon Sep 17 00:00:00 2001 From: James Earl Douglas Date: Sun, 24 Jul 2016 22:36:55 -0600 Subject: [PATCH] Expand side effects to include reading external mutable state --- readme.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 2a87f58..0748298 100644 --- a/readme.md +++ b/readme.md @@ -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!");