Build a Record Collection - task 3 & 6

Hey everybody!
I’m having trouble solving the task number 3 and number 6. Could anyone give me a hint or a tip of what am i doing wrong?
Thanks in advance :smiley:

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 !== "tracks" && value !== "") {
    records[id][prop] = value;
  } else if (
    prop === "tracks" &&
    value !== "" &&
    "tracks" in records[id][prop] === false
  ) {
    records[id]["tracks"] = [];
    records[id]["tracks"].push(value);
  } else if (prop === "tracks" && value !== "") {
    records[id][tracks].push(value);
  }
  return records;
}

What are tasks 3 and 6?

Which lines of your code do you think specifically should meet those requirements?

What debuging have you tried so far?

Maybe clean this up to remove redundancies in the if/else conditions so your code is easier to read and follow. For example, after you check if value is an empty string and it’s not, you don’t need to don’t need to repeatedly check if value is not an empty string, right? Same with prop === "tracks".

Is tracks here a variable that you’ve defined in your code?