var collection = {
"5439": {
"album": "ABBA Gold"
}
};
function updateRecords(id, prop, value) {
if(prop !== "tracks" && value !== ""){
collection[id].prop=value;
}
return collection;
}
updateRecords(5439, "artist", "ABBA");
why the result is Object { album="ABBA Gold", prop="ABBA"}
,not Object { album="ABBA Gold",artist="ABBA"}
?
When to parse collection[id].prop=value;
,the value of prop is artist,the value of id is 5439,so collection[id].prop=value;
should parsed into collection[5439].artist="ABBA";
,why not?