Skip to content

Commit 2be0ffd

Browse files
authored
Fix typos, 07-map-set-weakmap-weakset
1 parent 121c264 commit 2be0ffd

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The main methods are:
1616

1717
- `new Map()` -- creates the map.
1818
- `map.set(key, value)` -- stores the value by the key.
19-
- `map.get(key)` -- returns the value by the key.
19+
- `map.get(key)` -- returns the value by the key, `undefined` if `key` doesn't exist in map.
2020
- `map.has(key)` -- returns `true` if the `key` exists, `false` otherwise.
2121
- `map.delete(key)` -- removes the value by the key.
2222
- `map.clear()` -- clears the map
@@ -148,7 +148,7 @@ for(let amount of recipeMap.values()) {
148148
149149
// iterate over [key, value] entries
150150
for(let entry of recipeMap) { // the same as of recipeMap.entries()
151-
alert(entry); // cucumber,50 (and so on)
151+
alert(entry); // cucumber,500 (and so on)
152152
}
153153
```
154154
@@ -160,7 +160,7 @@ Besides that, `Map` has a built-in `forEach` method, similar to `Array`:
160160
161161
```js
162162
recipeMap.forEach( (value, key, map) => {
163-
alert(`${key}: ${value}`); // cucumber: 50 etc
163+
alert(`${key}: ${value}`); // cucumber: 500 etc
164164
});
165165
```
166166

0 commit comments

Comments
 (0)