Help with JS Coding challenge

Ok I’LL KEEP STUDYING

Sorry misclicked caps lock

I’ve been working really hard so I got this

function updateRecords(id, prop, value) {
  if(prop=== "tracks" && !collection[id].hasOwnProperty("tracks")){
    collection[id][prop]=[];
    collection[id][prop].push(value);
  }
  else if(prop=== "tracks" && value !== ""){
    collection[id][prop].push(value);
  }
  else if( value===""){
    delete collection[id][prop];
  }
  else  if(prop!=="tracks" && value !== ""){
   collection[id][prop]=value;
  }

  return collection;
}

I went over my if statements the != statements and got this

Good job working through the problem! Does your code work as you expect it to?

1 Like

Thank you nearly done just need to work through some bugs

Awesome. Happy coding!

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