Skip to content

Commit fec4742

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

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ 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
227-
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.
227+
That's for compatibility with `Map` where the callback passed `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
229229
The same methods `Map` has for iterators are also supported:
230230

0 commit comments

Comments
 (0)