I’m having trouble understanding this problem. I don’t understand how the updateRecord parameters are being passed in. In our setup above there are no variables in our object equated to records, prop, id, or value.
Am I missing something here? I feel like a skipped a lesson or something, how are these parameters being passed in?
**Your code so far**
// Setup
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) {
if (prop !== track && value !== ""){
records[id][prop]
}
return records;
}
updateRecords(recordCollection, 5439, 'artist', 'ABBA');
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
Are these variables just being declared and tested when you run the code on FCC? Or does the program understand somehow that prop will be the strings and specifically it will be ‘artist’ or ‘tracks’, etc.
Right, but can you point to me where that is happening in the record collection problem? Are the parameters being defined after the fact when you run the code? I think that’s where i’m confused
The parameters are defined every time the function is called. The tests call your function many times and make sure it returns the right output for specific inputs.
The function calls are listed below the challenge description.