var coworkers = {
"programmer": "egoing",
"designer": "leezche"
};
document.write("programmer : " + coworkers.programmer + "<br>")
document.write("designer : " + coworkers.designer + "<br>")
coworkers.bookeeper = "duru";
document.write("bookeeper : " + coworkers.bookeeper + "<br>");
coworkers["data scientist"] = "taeho";
document.write("data scientist : " + coworkers["data scientist"] + "<br>");
for (var key in coworkers) {
document.write(key+'<br>');
}
for (var key in coworkers) {
document.write(coworkers[key]+'<br>');
}
순서대로 나왔으나 순서 보장 못함
for (var key in coworkers) {
document.write(key + ' : ' + coworkers[key] + '<br>');
}