Hi all!
I’m a newbie here as well. I’m not sure how to go about using the push method to fulfill the 2nd requirement:
• If prop is tracks but the album doesn’t have a tracks property, create an empty array and add value to it.
My code so far:
function updateRecords(records, id, prop, value) {
if (prop != "tracks" && value != "") {
records[id][prop] = value;
} else (prop == "tracks" && records[id].hasOwnProperty("tracks") == false) {
records.id.push(prop.value);