Skip to content

Instantly share code, notes, and snippets.

@MedinaGitHub
Created September 1, 2017 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MedinaGitHub/41206bb343ab77cca96a9d69acb8a705 to your computer and use it in GitHub Desktop.
Save MedinaGitHub/41206bb343ab77cca96a9d69acb8a705 to your computer and use it in GitHub Desktop.
//los mapas
let mapa = new Map();
mapa.set("nombre","sebastian");
mapa.set("edad",21);
console.log(mapa); //{"nombre" => "sebastian"} {"edad" => 21}
//inicializandolo con valores
let mapa2 = new Map( [ ["nombre","sebastian"] , ["edad",21] ]);
console.log(mapa2); //{"nombre" => "sebastian"} {"edad" => 21}
//Nueva iteracion con for of
for(let ma of mapa){
console.log(ma);
}
//Iterandolo con for in
for(let i in mapa){
console.log(numbers[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment