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'
}
};
**// Only change code below this line**
function updateRecords(records, id, prop, value) {
**2548 Jon Bon Jovi**
if (value === "") {
delete records[id].artist;
delete records[id].tracks;
}
**//5439 ABBA**
else if (prop === 'tracks') {
recordCollection[id].tracks = [];
records[id].tracks.push(value);
This is the error iMessage I am getting in regards to the ABBA song:
After updateRecords(recordCollection, 5439, “tracks”, “Take a Chance on Me”), tracks should have the string Take a Chance on Me as the last element.I Think they want me to Create an Array? But I thought the Abba song was the last element
**// 5439 ABBA**
} else if (prop === "artist") {
records[id].artist = value;
**// 1245 Robert Palmer**
} else if (prop === "tracks") {
records[id].tracks.push(value);
**// 1245 Robert Palmer**
} else if (prop != "tracks") {
records[id].albumTitle = "Riptide";
}
return records;
}