Skip to content

Commit 25bd92c

Browse files
committed
Make easy for example of hoc
1 parent f279ee6 commit 25bd92c

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

readme.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,7 @@ console.log(arity) // 2
8080
A function which takes a function as an argument and/or returns a function.
8181

8282
```js
83-
const filter = (predicate, xs) => {
84-
const result = []
85-
for (let idx = 0; idx < xs.length; idx++) {
86-
if (predicate(xs[idx])) {
87-
result.push(xs[idx])
88-
}
89-
}
90-
return result
91-
}
83+
const filter = (predicate, xs) => xs.filter(predicate)
9284
```
9385

9486
```js

0 commit comments

Comments
 (0)