Javascript -Record Collection Problem

Tell us what’s happening:
One of the requirements is that the album doesnt have a “tracks” property
Is that the ID its talking about because album is a property itself of the ID along with tracks
I dont believe tracks is embedded array of album.
I am a little confused

Your code so far


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

// Only change code below this line
function updateRecords(id, prop, value) {



return collection;
}

// Alter values below to test your code
updateRecords(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/79.0.3945.130 Safari/537.36.

Challenge: Record Collection

Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/record-collection

Each entry conceptually represents a musical album. The album property is really the name of the album. I see how it’s confusing. The wording could be improved.

1 Like

Yeah poor wording .
The requirement says : “If prop is "tracks" but the album doesn’t have a "tracks" property, create an empty array before adding the new value to the album’s corresponding property. "
The code explanation says: " First checks if prop is equal to tracks AND if value isn’t a blank string. If both tests pass, value is pushed into the tracks array.”
It basically says 2 things as the album doenst have a tracks property create an empty array but the explanation says if the VALUE isnt blank.
Thanks for your help