mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-06 02:26:43 +00:00
Make easy for example of hoc
This commit is contained in:
parent
f279ee6490
commit
25bd92ce94
1 changed files with 1 additions and 9 deletions
10
readme.md
10
readme.md
|
|
@ -80,15 +80,7 @@ console.log(arity) // 2
|
|||
A function which takes a function as an argument and/or returns a function.
|
||||
|
||||
```js
|
||||
const filter = (predicate, xs) => {
|
||||
const result = []
|
||||
for (let idx = 0; idx < xs.length; idx++) {
|
||||
if (predicate(xs[idx])) {
|
||||
result.push(xs[idx])
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
const filter = (predicate, xs) => xs.filter(predicate)
|
||||
```
|
||||
|
||||
```js
|
||||
|
|
|
|||
Loading…
Reference in a new issue