Skip to content

Instantly share code, notes, and snippets.

@cesarkohl
Created January 13, 2020 14:38
Show Gist options
  • Select an option

  • Save cesarkohl/fd68ae5a1f177e7d7f3cb7924e526ef3 to your computer and use it in GitHub Desktop.

Select an option

Save cesarkohl/fd68ae5a1f177e7d7f3cb7924e526ef3 to your computer and use it in GitHub Desktop.
var map = new Map ();
mapa.set ('um', 1);
mapa.set ('two', 2);
mapa.set ('three', 3);
for (var key of mapa.keys ()) {
 console.log (key); // one two Three
}
for (var value of mapa.values ​​()) {
 console.log (value); // 1 2 3
}
for (var entry of mapa.entries ()) {
 console.log (input);
}
// output:
// ['one', 1]
// ['two', 2]
// ['three', 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment