And the property tracks within that record id can be accessed as: recordCollection['2468']['tracks']
In the updateRecords function, the value of records is recordCollection, the value of id can be 2468, the value of prop can be one of artist, tracks, etc., and the value of value can be any string, e.g., "some value".
NOTE that your code needs to be with the function updateRecords.
Thanks for your detailed explanation. However I can’t seem to be able to understand yet.
1.Are those arguments same hierarchy?
2. Why do we need [ id ] between records and [prop]?
These questions are haunting me…
There are two aspects to this question, I think, you need to know. First, how do you access the value of a property, for an object? Next, what is a function, and what are the various aspects of a function?
When you are clear about these, you will know more about the issue you are facing (and answers).
Thank you for following explanation. After posting here, I also asked about this in a different website. And then I got very clear diagram to understand the structure. So now I think I’ve got better understanding about this question.
To answer the first, I’ve learned that [id]and [prop]are in different hierarchy, meaning I have to use two .
For the second, I basically consider function as group of data. And its data can be changed by declaration.
I obviously know this understanding has lots of missing, but I just want to check if current state is in right direction.