Basic JavaScript - Record Collection Challenge, Theory Help

Tell us what’s happening:
Describe your issue in detail here.

Hi everyone, I have a fast question about the theory behind this question/coding challenge. I was super stumped on this, and I still am regarding the ‘records’ component of this. I’m not seeing anywhere…

let ‘records’ = “”

or

let ‘records’ = “recordCollection”.

I’m feeling confused because I’m not sure where the ‘records’ object even came from. I see we’re passing it through the updateRecords function, but I’m still confused what ‘records’ even refers to, as it’s not been assigned a value, and in the hints, they are not assigning the object ‘records’ a value either.

This is kind of a weird question because I just need a leg up understanding where the ‘records’ object came from and how we’re supposed to use it. I hope that makes sense, and thank you for your help!

  **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) {
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/104.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Record Collection

Link to the challenge:

For reference, here is the remainder of the code to work on - you don’t have to give me the answer, I just want to understand the ‘records’ object, where it came from, what we’re supposed to do with it/how we should think of it.

// Only change code below this line
function updateRecords(records, id, prop, value) {
  return records;
}

updateRecords(recordCollection, 5439, 'artist', 'ABBA');

You are calling the function right here.

That basically assigns records = recordCollection, id = 5439, prop = 'artist', value = 'ABBA'

It happens in the call to the function. recordCollection has already been initialized at the top of the code, so it just gets pass to the function as the first argument. Inside the function, the records parameter receives the reference to recordCollection.

That makes a lot of sense. Thanks!

This explanation helped me better pin down what we’re working on with this challenge. Thank you!!