function change_obj(obj) {
for (var key in obj) {
obj[key]=obj[key].toUpperCase();
}
}
function doesnt_change_str(str) {
str = str.toUpperCase();
}
function main() {
var cities = {
"New York" : "USA",
"Berne" : "Switzerland",
"Munich" : "Germany",
"Paris" : "France",
};
var cities_copied = cities;
change_obj(cities);
delete cities_copied["Munich"];
for (var city_name in cities) {
txt_out(city_name + "=" + cities[city_name]);
}
txt_out("----");
delete cities["New York"];
for (var city_name in cities_copied) {
txt_out(city_name + "=" + cities_copied[city_name]);
}
txt_out("---");
if (cities == cities_copied) {
txt_out("cities == cities_copied");
}
else {
txt_out("not cities == cities_copied");
}
if (cities === cities_copied) {
txt_out("cities === cities_copied");
}
else {
txt_out("not cities === cities_copied");
}
// ---
var name_of_fruit = "banana";
doesnt_change_str(name_of_fruit);
txt_out("name_of_fruit: " + name_of_fruit);
}