I do not understand the reason why my functions does not work. I write conditions from the last one to the first one
function updateRecords(id, prop, value) {
var a=["collection"]["id"]["prop"]["value"];
var b= ["collection"]["id"]["prop"]["tracks"];
var c= ["collection"]["id"]["prop"] ;
if (a==""){
delete prop;
}else if(b!=="")
tracks.push(value);
return collection;
}