Can you please shed some light on the difference between collection[id][prop] = [value] and collection[id][prop] = value ? The problem has haunted me for few days. Thank you loads!
The code above is from Basic Code Solution in guide section. Have a nice day!
The only difference is when you add the [ and ] around value, you assigning an array of one element (value) instead of just value to collection[id][prop]. The “tracks” property needs to be an array with the first element of value if there is not already a “tracks” property, because if “tracks” already exists, then you know it has to be an array.