Basic JS| Record Collection|I don't know why my code does not pass the test?I will be grateful If you can help me

function updateRecords(records, id, prop, value) {
 const a = records[id].hasOwnProperty(prop);
  if(value === ""){
    delete records[id].prop;
  }else if(prop === "tracks" && a === false

  }else if(prop === "tracks" && a === true) {
  }else if(prop !== "tracks"){
  return records;

updateRecords(recordCollection, 5439, 'artist', 'ABBA');

Welcome to the forum!

Please provide link to the task, and consider to format your code:

You can’t use dots here. You are dealing with variables, brackets needed

1 Like