Build a Record Collection - Build a Record Collection

Tell us what’s happening:

I keep on failing tests 3, 5, 6 in this project, and I have no clue to why

Your code so far

const recordCollection = {
  2548: {
    albumTitle: 'Slippery When Wet',
    artist: 'Bon Jovi',
    tracks: ['Let It Rock', 'You Give Love a Bad Name']
  },
  2468: {
    albumTitle: '1999',
    artist: 'Prince',
    tracks: ['1999', 'Little Red Corvette']
  },
  1245: {
    artist: 'Robert Palmer',
    tracks: []
  },
  5439: {
    albumTitle: 'ABBA Gold'
  }
};

function updateRecords(records, id, prop, value) {
  if (value === "") {
     delete records[id][prop]
  } else if (prop !== records["tracks"] && value  !== "") {
    records[id][prop] = value 
  } else if (records[id][prop] == records["tracks"] && value !== "" ) {
    if (!Array.isArray("tracks")) {
      new Array("tracks").push(records[id][value]) 
    } else {
      records[id]["tracks"].push(records[id][value])
    }
  }
  return records
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 OPR/122.0.0.0

Challenge Information:

Build a Record Collection - Build a Record Collection

Here are some troubleshooting steps you can follow. Focus on one test at a time:

  1. Are there any errors or messages in the console?
  2. What is the requirement of the first failing test?
  3. Check the related User Story and ensure it’s followed precisely.
  4. What line of code implements this?
  5. What is the result of the code and does it match the requirement? (Write the value of a variable to the console at that point in the code if needed.)

If this does not help you solve the problem, please reply with answers to these questions.