Where's the difference

I’m doing the record collection challenge in javascript. The solution from hints is:

  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] = [value];
  } else if (prop === "tracks" && value !== "") {
    object[id][prop].push(value);
  } else if (value === "") {
    delete object[id][prop];
  }
  return object;

my solution is:

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

but it doesn’t work, what am I missing?

Hi Levi,
You have a typo in the fifth line (obcet) :smiley:
Cheers

Time to play every programmer’s favorite game: Spot the Typo!

1 Like

Lol, I’m gonna have to get good at this

2 Likes

Looks like you are good at it to me. Typos don’t make you bad when you basically have the correct answer bar said typo.