mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 02:28:20 -05:00
Change wording in Iterators and Generators
I found the term "function constructors" to be confusing as the functions the section refers to are not constructors. I think "higher-order functions" or something similar would be more clear. Thanks!
This commit is contained in:
@@ -767,7 +767,7 @@
|
||||
|
||||
## Iterators and Generators
|
||||
|
||||
- Don't use iterators. Prefer JavaScript's function constructors instead of loops like `for-of`.
|
||||
- Don't use iterators. Prefer JavaScript's higher-order functions like `map()` and `reduce()` instead of loops like `for-of`.
|
||||
|
||||
> Why? This enforces our immutable rule. Dealing with pure functions that return values is easier to reason about than side-effects.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user