I’ve been stuck at this for two weeks, now. I struggle, and hit the wall, I go back and review the earlier lessons, but there seems to be a rather large gap between the difficulty on this particular challenge and everything prior to it. I don’t feel I was entirely prepared for this, to be honest.
Here’s my code. I am sure there’s a lot I am missing here.
function updateRecords(object, id, prop, value) {
if (prop !== "tracks" && value !== "") {
return object[id][prop] == value;
}
else if (prop == "tracks" && id.hasOwnProperty(tracks) ) {
return object[id][prop].push([value]);
}
else if (prop == "tracks" && value !== "") {
return object[id][prop].push([value]);
}
else if (value == "") {
delete object[id][prop];
}
}
Any feedback on what I am missing is appreciated. Thank you.