function updateRecords(object, id, prop, value) {
if (prop != collection.tracks && value != "") {
var prop = collection.tracks;
return object;
}
else if (prop == tracks || object.tracks == undefined) {
return object;
}
Your function is not modifying the object passed into it. You should be changing the property values of the object before you return the object.
Also, you don’t want to reference collection in your function. Basically, forget that collection even exists. You are only accessing/modifying the object passed into the function. collection is just there to give you an example of what the object passed into your function will look like.
And in your else if condition you have prop == tracks but you haven’t declared/defined tracks anywhere. Besides, I think tracks is supposed to be a string, right, so you’d want it to be prop === 'tracks'.