Please help fdfdfdfdfdfdf

After updateRecords(collection, 5439, "tracks", "Take a Chance on Me") , tracks should have Take a Chance on Me as the last element. Only one isnt true reminders are true
function updateRecords(object, id, prop, value) {

if(prop !== ‘tracks’ && value !== “”){

object[id][prop] = value

}

else if(prop ===‘tracks’ && !object[id].hasOwnProperty(‘tracks’)){

object[id][prop] =

}

else if(prop ===‘tracks’ && value !== ‘’){

var tracksEl = object[id].tracks

tracksEl.push(value)

} else if(value === “”){

delete object[id][prop]

}

return object;

}

Please sorry for post I think my solve is absolutly true but freecodecamo dont recive my solution. Please help me https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/record-collection

could you please elaborate? is updateRecords() your custom defined function? or is it a method from an imported module?

1 Like

I’m sorry, I’m used to answering fb group posts, where everything needs context. Is this from a challenge or a lesson? Do you have the link to it?

1 Like

Welcome, baxa.

Please edit your post to include a descriptive title. Descriptive titles, such as “Why does my function return undefined?”, are more likely to elicit helpful responses than generic titles, such as “Help please”.


For future posts, if you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like

Sorry bro for old my post, I cant find solution