Working with objects in JS?

Hi!
Pass freeCodeCamp are now working with objects in this task, all done, but at random, because I do not have an understanding of difference access that object's properties.
In the course Goritsa that to reach out either using a dot or using the square brackets, but it didn't worked, so that's how reason works:
collection[id].tracks.push(value)
but so-not:
collection[id][tracks].push(value)
Although at the same time that it works:
collection[id][prop] = value;
I suspect that it depends on whether the property is an array, but just to indicate that there was no explanation. Can more detail be explained?
April 4th 20 at 00:39
1 answer
April 4th 20 at 00:41

Find more questions by tags JavaScript