Skip to content

Commit d8e04e4

Browse files
update description regarding forEach method on Set
1 parent f1bf4f1 commit d8e04e4

File tree

1 file changed

+1
-1
lines changed
  • 1-js/05-data-types/07-map-set-weakmap-weakset

1 file changed

+1
-1
lines changed

1-js/05-data-types/07-map-set-weakmap-weakset/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ set.forEach((value, valueAgain, set) => {
222222
});
223223
```
224224
225-
Note the funny thing. The `forEach` function in the `Set` has 3 arguments: a value, then *again a value*, and then the target object. Indeed, the same value appears in the arguments twice.
225+
Note the funny thing. The callback function passed in `forEach` has 3 arguments: a value, then *again a value*, and then the target object. Indeed, the same value appears in the arguments twice.
226226
227227
That's for compatibility with `Map` where `forEach` has three arguments. Looks a bit strange, for sure. But may help to replace `Map` with `Set` in certain cases with ease, and vice versa.
228228

0 commit comments

Comments
 (0)