Hello, this was very difficult to say the least , had to see the solution in order to get it correct,
however i was on the right track and this is where my question comes from.
i was using the id as reference via id[prop] because given this code
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'
}
};
i did not see the record handle anywhere .
i am thinking that records here is synonymous to the name of the objects const recordcollection.
if so, am i right to assume that a parameter of a function can be named anything and once the name of an object is referenced inside , they type of data structure is fetched by javascript itself?
please post a link to the challenge for our reference so we can see it with you.
As I recall, there was a function call that provided this object as an argument to the function.
So inside the function, you were supposed to use the parameter given to you (I recall it was called records)
In the case of record collection, there is a global variable named recordCollection, and a function updateRecords whose first parameter is named records. In the example function call they pass recordCollection as the first argument to updateRecords.
and you must always reference whats in the parameter rather than the source that is passed in , otherwise it wouldn’t work for anything that is passed in, thank you i understand now .