Skip to content

Commit 658c3ba

Browse files
committed
In JS Map .values() example, renamed the loop variable in for-of from key to value for clarity, as .values() returns map values, not keys.
1 parent 3e8fcd3 commit 658c3ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/cheatsheet/map.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ You can iterate over the map values using `values()` method as in the order it w
143143
```javascript
144144
const map = new Map()
145145
map.set('name', 'Bob').set('age', 20)
146-
for (const key of map.values()) {
147-
console.log(`${key}`)
146+
for (const value of map.values()) {
147+
console.log(`${value}`)
148148
}
149149

150150
// Bob

0 commit comments

Comments
 (0)