Created
September 1, 2017 13:49
-
-
Save MedinaGitHub/41206bb343ab77cca96a9d69acb8a705 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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