Hi! I’ve managed to complete all the steps, except for the last one:
If the album doesn’t have a "tracks"
property, create a new array for the album’s “tracks"property before adding the
value` to it.”
From what I understand I have to assign a new array called tracks, but how do i name the array? I tried googling it, but couldnt really find anything.
Am I misunderstanding something?
my code:
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 !== “”) {
records[id][“tracks”].push(value);
} else if (records[id].hasOwnProperty(“tracks”)) {
records[id] = newArray(“tracks”);
}
return records;
}