Record Collection Editor

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

I’ve read over this challenge a few times and I’ve referenced the hint, and I can’t figure out what i’m doing wrong. I don’t want to copy&paste the hint, that would not help me learn. Can someone show me where I’m messing up?

When i read the challenge statements and my code - it seems to make sense but i’m obviously missing something.


  **Your code so far**

// Setup
const 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) {
if (prop !== 'tracks' && value !== ""){
  records[id][prop] = value;
} else if 
(prop === "tracks" && record[id].hasOwnProperty("tracks") === false){
 records[id][prop]= [value];
} else if 
  (prop === "tracks" && value !== ""){
  } else if 
  (value === ""){
    delete records[id][prop];
return records;

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/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53

Challenge: Record Collection

Link to the challenge:

record[id].hasOwnProperty("tracks") === false)

Are you sure you want to use record here? What is the parameter name?

jeesh …

When I get stuck on a complicated function like this it makes me think “am i really going to be able to code? can I do this?” and then the fix is something very simple that I was simply overlooking.

Thank you for your help!

Get used to it, it will happen over and over again.

Typos and small mistakes are very common and can lead to long debugging sessions that end with facepalming as you realize the error.

So, it’s safe to say I’m not the first? :rofl:

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