Explain Me Like I'm A 9yr 🐌

Tell us what’s happening:
Describe your issue in detail here.
Hellooo Awesome Ppl of FCC I hope Ya’All doing GREAT …

Here I am struggling to understand this question solution. Could anyone plz go through the solution and explain it to me… I really wanna understand this … Thank You :relaxed:

  **Your code so far**

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

updateRecords(recordCollection, 5439, 'artist', 'ABBA');
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36

Challenge: Record Collection

Link to the challenge:

what parts are confusiong you?
what is it that you don’t understand?

Okie I guess I took a bit too serious about myself as a 9yr old and didn’t specify my confusion part…

Well, let’s start with what I think I am able to understand. So far I can see there is an object with a name recordCollection and it has 4 elements in it. And we are creating a function with 4 parameters. Records = object/“recordCollection”, id = 2548/2468 …, prop = artist/tracks…, value = whatever the value we want to input or change is it right so far?

I get issues with creating the function part, the logical part. Even though I read the question I just get confused with building this stuff… You know what I mean? How does function understand when I say records, id, prop and value. How does the function know that “records” mean fetch info from “recordCollection” or “Id” means "2458 " so on… and are there any limitations of arguments in function? or we can put as many according to the object or arrays? I think all these things are easy it’s just not clicking in my head yet :sweat_smile:

btw how’s your washing machine? did you able to fix it haha …

Thanks

P.S don’t worry im, not a stalker just a curious person.

When the function is called, certain arguments are passed in, and these arguments become

You need to take the object that is passed in as records and update it based upon the id, prop, and value provided.

cool cheers. Post must be at least 20 charactersPost must be at least 20 charactersPost must be at least 20 characters…