Record Collection test

Please i am unable to pass the record collection test on fcc. Here is my code:

function updateRecords(records, id, prop, value) {

    if (prop != 'tracks' && value != '') {

       return records[id][prop] = value;

       }  

       else if (prop == 'tracks' && records[id].hasOwnProperty("tracks") == false) {

      return records[id][prop] = [value];

       } 

       else if (prop == 'tracks' && value != '') {

        return records[id][prop].push(value);   

       }else if (value == '') {

           return delete records[id][prop];

           } else

    return records;

  }
Find the link below:

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/record-collection
Thanks.

please provide the link to the challenge

for next time you can just use the Ask for help button, which will create a precompiled topic with your code and challenge link, and you will still have space to ask your questions

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