so this line says “If the property is ‘tracks’, and the collection doesn’t have the tracks property (not the collection[id], but the collection), then go ahead and push something onto the tracks property of collection[id].”
Ahh… i get what u mean, so i have updated the code to this
but there’s still an error,
the error says "After updateRecords(1245, “tracks”, “Addicted to Love”), tracks should have "
I thought i did push it to the back of the array using .push()
… And you just went from one extreme to the other. Now, you’re saying “Whether or not you have a tracks property, set it to an empty array, and push this value onto it.”
So is there a way you can check if there is a property called tracks already and, if there’s NOT, then create an empty array? Then, either way, you can simply push the new value onto that.
Thank you for being patient to me…
so… i’ve manage to go this far, i thought i got all of it correct but there’s still an error saying:
“After updateRecords(5439, “tracks”, “Take a Chance on Me”), tracks should have “Take a Chance on Me” as the last element.”
you are saying, if collection[id][prop] is truthy (in this case is like “if it is not an empty array or undefined”) then push the value to it, else create an empty array
(don’t you think there is something missing?)