Skip to content

Instantly share code, notes, and snippets.

@nairihar
Created July 1, 2018 09:31
Show Gist options
  • Save nairihar/636a706db5777a6753e29c96b89c89d7 to your computer and use it in GitHub Desktop.
Save nairihar/636a706db5777a6753e29c96b89c89d7 to your computer and use it in GitHub Desktop.
JavaScript series, part 2, Map, medium
const myMap = new Map();
myMap
.set('k1', 1)
.set('k2', 2);
for (let item of myMap) {
console.log(item);
}
// ['k1', 1]
// ['k2', 2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment