From 2be0ffd289a88d2b35d3e56d06318e1a17348d2a Mon Sep 17 00:00:00 2001 From: Georgy Date: Mon, 2 Oct 2017 14:29:44 -0400 Subject: [PATCH] Fix typos, 07-map-set-weakmap-weakset --- 1-js/05-data-types/07-map-set-weakmap-weakset/article.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/05-data-types/07-map-set-weakmap-weakset/article.md b/1-js/05-data-types/07-map-set-weakmap-weakset/article.md index 40ff18b5..0769f57d 100644 --- a/1-js/05-data-types/07-map-set-weakmap-weakset/article.md +++ b/1-js/05-data-types/07-map-set-weakmap-weakset/article.md @@ -16,7 +16,7 @@ The main methods are: - `new Map()` -- creates the map. - `map.set(key, value)` -- stores the value by the key. -- `map.get(key)` -- returns the value by the key. +- `map.get(key)` -- returns the value by the key, `undefined` if `key` doesn't exist in map. - `map.has(key)` -- returns `true` if the `key` exists, `false` otherwise. - `map.delete(key)` -- removes the value by the key. - `map.clear()` -- clears the map @@ -148,7 +148,7 @@ for(let amount of recipeMap.values()) { // iterate over [key, value] entries for(let entry of recipeMap) { // the same as of recipeMap.entries() - alert(entry); // cucumber,50 (and so on) + alert(entry); // cucumber,500 (and so on) } ``` @@ -160,7 +160,7 @@ Besides that, `Map` has a built-in `forEach` method, similar to `Array`: ```js recipeMap.forEach( (value, key, map) => { - alert(`${key}: ${value}`); // cucumber: 50 etc + alert(`${key}: ${value}`); // cucumber: 500 etc }); ```