Help not able to solve

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

// Setup
var recordCollection = {
2548: {
  albumTitle: 'Slippery When Wet',
  artist: 'Bon Jovi',
  tracks: ['Let It Rock', 'You Give Love a Bad Name']
},
2468: {
  albumTitle: '1999',
  artist: 'Prince',
  tracks: ['1999', 'Little Red Corvette']
},
1245: {
  artist: 'Robert Palmer',
  tracks: []
},
5439: {
  albumTitle: 'ABBA Gold'
}
};

// Only change code below this line
function updateRecords(records, id, prop, value) {
recordCollection.5439.
return recordCollection;
}

updateRecords(recordCollection, 5439, 'artist', 'ABBA');
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36

Challenge: Record Collection

Link to the challenge:

Hi @garimajain4752 ,

If the problem is with the logic, then you could use if else statements inside your function to check for the conditions mentioned in the instructions. It could seem a lot, so start with the first condition of value being empty, then the next and so on.

Also, recordCollection.5439. won’t work inside the function.
In your case, the way to access any value inside the records object would be
records[id][prop]

Lastly, it’s a good idea to print the values to the console to check our code. It helps to debug. So you could try doing the below to check the values you are manipulating.
console.log(records[id][prop])

Hope this helps.

If you need the solutions , just click the “get help” button at the exercise page, you will see a “get a hint” link which will lead you to the solution (Two are given there). I’m not ok with copying the answers, pasting it, passing the test and moving on. If you do that, you will miss the whole point of what FCC want you to achieve . BELIEVE ME. But rather study it and learn from it. But first, just do your best to solve the problem and if you know you can’t, then check it out.
And @garimajain4752, welcome to the community.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.