Skip to content

Commit e1c0d62

Browse files
authored
Merge pull request #1044 from Violet-Bora-Lee/patch-6
update description regarding forEach method on Set
2 parents 1b963bd + f752403 commit e1c0d62

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

+2-2
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)