mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-12 13:36:40 +00:00
Merge pull request #52 from neighborhood999/patch-1
use `let` instead of `var` in for loop.
This commit is contained in:
commit
9397e16816
1 changed files with 1 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ A function which takes a function as an argument and/or returns a function.
|
||||||
```js
|
```js
|
||||||
const filter = (pred, xs) => {
|
const filter = (pred, xs) => {
|
||||||
const result = [];
|
const result = [];
|
||||||
for (var idx = 0; idx < xs.length; idx++) {
|
for (let idx = 0; idx < xs.length; idx++) {
|
||||||
if (pred(xs[idx])) {
|
if (pred(xs[idx])) {
|
||||||
result.push(xs[idx]);
|
result.push(xs[idx]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue