Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0dae82

Browse files
committed
update map & filter fundamental
1 parent 55cf38b commit f0dae82

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fundamentals/map_filter.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ Result:
199199

200200
### Method chaining
201201

202-
The methods **map()**, **filter()** and **reduce()** each return a new array. This makes it possible to chain these methods and create a 'pipeline' of operations, to be applied in sequence. Let's take the last example, but now filtering out only those array elements for which the name starts with a 'J':
202+
The methods **map()** and **filter()** each return a new array. This makes it possible to chain these methods and create a 'pipeline' of operations, to be applied in sequence. The **reduce** method can return anything, including an array. If a **reduce** method returns something other than an array it can only be included at the end of an array method chain.
203+
204+
Let's take the last example, but now filtering out only those array elements for which the name starts with a 'J':
203205

204206
```js
205207
const arr = [

0 commit comments

Comments
 (0)