From 714f71d1d2f9788742e0949dabb0cee4677e8929 Mon Sep 17 00:00:00 2001 From: Felix Sanz Date: Tue, 23 Feb 2016 01:25:02 +0100 Subject: [PATCH] Added getter/setter info I tried to search for getter/setter in the readme but nothing was found. Added some info to make a clear statement about them --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f1dadba1..06a4eb6b 100644 --- a/README.md +++ b/README.md @@ -1033,7 +1033,7 @@ Other Style Guides - [11.1](#11.1) Don't use iterators. Prefer JavaScript's higher-order functions like `map()` and `reduce()` instead of loops like `for-of`. eslint: [`no-iterator`](http://eslint.org/docs/rules/no-iterator.html) - > Why? This enforces our immutable rule. Dealing with pure functions that return values is easier to reason about than side-effects. + > Why? This enforces our immutable rule. Dealing with pure functions that return values is easier to reason about than side effects. ```javascript const numbers = [1, 2, 3, 4, 5]; @@ -2217,7 +2217,7 @@ Other Style Guides ## Accessors - [23.1](#23.1) Accessor functions for properties are not required. - - [23.2](#23.2) If you do make accessor functions use getVal() and setVal('hello'). + - [23.2](#23.2) Do not use JavaScript getters/setters as they cause unexpected side effects and are harder to test, maintain, and reason about. Instead, if you do make accessor functions, use getVal() and setVal('hello'). ```javascript // bad