added explanations, closes #798

This commit is contained in:
Ilya Kantor 2019-03-07 13:58:04 +03:00
parent 5bca8a5ee2
commit 594cc4a6d6

View file

@ -159,6 +159,7 @@ The iteration goes in the same order as the values were inserted. `Map` preserve
Besides that, `Map` has a built-in `forEach` method, similar to `Array`:
```js
// runs the function for each (key, value) pair
recipeMap.forEach( (value, key, map) => {
alert(`${key}: ${value}`); // cucumber: 500 etc
});