02-Collection-Map.html
Dosyayı İndir
<html>
<head>
<script>
var countries=new Map();
countries.set("tr","Türkiye");
countries.set("az","Azerbaycan");
countries.set("tm","Türkmenistan");
countries.set("uz","Özbekistan");
countries.set("kg","Kırgızistan");
countries.set("kz","Kazakistan");
var found=countries.get("uz");
console.log("UZ: "+found);
if(countries.has("dt")){
console.log("Doğu Türkistan Yok");
}else{
console.log("Doğu Türkistan Var");
}
console.log("Boy: "+countries.size);
for(var country of countries.values() ){
console.log("- "+country);
}
for(var code of countries.keys() ){
console.log("# "+code+" : "+ countries.get(code));
}
for(var [code,country] of countries.entries() ){
console.log("* "+code+" : "+ country);
}
</script>
</head>
<body>
<h1> Eşlem </h1>
</body>
</html>
Dosyayı İndir