The Record Collection Exercise

Hi ,
I have attempted this exercise but the code will not be accepted . The code is below:

function updateRecords(object, id, prop, value) {
if(prop != “tracks” && value !=""){
collection[id][prop] = value;
} else if(prop === “tracks” && collection[id][prop]=== undefined) {
collection[id][prop] = [value];
} else if (value === “”) {
delete collection[id][prop]
} else if (prop === “tracks”) {
collection[id][prop].push(value);
}

return collection;
}

Can anyone assist?
Thanks

You are using collection. You need to use the object passed into the function.

Hi,

Thanks for your time and input. I have just completed the exercise, there were a few syntax additions I had to make before it passed.

Regards,
Ray

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.