Tell us what’s happening:
This question is really bad for beginners , I tried solving it 50 different times , looking up different methods and asking questions on stack overflow (which doesnt help because they dont actually tell you the answer they just try to make you troubleshoot with stuff you dont know) and asking friends.
when I saw the video on how to solve it I almost quit even trying to learn ,
the way the question is worded makes the student think that you solve the problem in the order that the tasks are given ( just like every other question you get on every other lesson) but when I looked at the video the guy solves it from the bottom up which makes no sense given the format that the student has been seeing for 70 lessons.
in addition there are no lessons before that which give context into how the problem is actually solved. the links to the hints are useless.
I’m sorry for the rant, I’ve been trying to beat this problem for 2 weeks now and now I just feel like I havent learned anything at all . I went back through each problem for two weeks trying to solve it and nothing helped.
Your code so far
// Setup
var collection = {
2548: {
album: "Slippery When Wet",
artist: "Bon Jovi",
tracks: [
"Let It Rock",
"You Give Love a Bad Name"
]
},
2468: {
album: "1999",
artist: "Prince",
tracks: [
"1999",
"Little Red Corvette"
]
},
1245: {
artist: "Robert Palmer",
tracks: [ ]
},
5439: {
album: "ABBA Gold"
}
};
// Only change code below this line
function updateRecords(id, prop, value) {
if (value ===""){
delete collection[id][prop];
}else if (prop === "tracks"){
collection[id][prop] = collection[id][prop] || [];
collection[id][prop].push(value);
}else {
collection[id][prop] = value;
}
return collection;
}
updateRecords(5439, "artist", "ABBA");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0
.
Challenge: Record Collection
Link to the challenge: