mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-06 02:26:43 +00:00
parent
eb4481cac9
commit
6256c79347
1 changed files with 2 additions and 2 deletions
|
|
@ -76,10 +76,10 @@ console.log(arity); // 2
|
|||
A function which takes a function as an argument and/or returns a function.
|
||||
|
||||
```js
|
||||
const filter = (pred, xs) => {
|
||||
const filter = (predicate, xs) => {
|
||||
const result = [];
|
||||
for (let idx = 0; idx < xs.length; idx++) {
|
||||
if (pred(xs[idx])) {
|
||||
if (predicate(xs[idx])) {
|
||||
result.push(xs[idx]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue