Hey Guys i having problem with this challenge.
I don’t understand why he keeps telling me that that part doesn’t work. If I am putting a yes where I push the parameter value when prop === “tracks” I asked for help before but it is not clear. sorry for not be good.
After updateRecords(5439, "tracks", "Take a Chance on Me")
, tracks
should have "Take a Chance on Me"
as the last element.
function updateRecords(id, prop, value) {
if(prop !== "tracks" && value !== "" ){
collection[id][prop]=value;
}
if(prop === "tracks" && value !==""){
collection[id][prop].push(value);
}
if(prop === "tracks" && collection.hasOwnProperty("tracks")){
collection[id][prop]=[];
collection[id][prop].push(value);
}
if(value === ""){
delete collection[id][prop];
}
return collection;
}
updateRecords(5439, "artist", "ABBA");