Basic JavaScript - Record Collection

Tell us what’s happening:
Describe your issue in detail here.
Having issues even getting started. I do not understand this question. At all. Please provide some sort of guidance to get me on the right track. Maybe I’m approaching it wrong. Thanks you!
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) {
  updateRecords();
}

updateRecords(recordCollection, 5439, 'artist', 'ABBA');

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Record Collection

Link to the challenge:

we need to understand what -you- understand first.
Tell us what you think this code is meant to do and what the exercise is asking you for as per your understanding.
Or, you can point out a sentence that you didn’t understand if the issue is one sentence for eg.

I completed this one last year, and revisited recently to refresh. If you’re completely lost I’d do the following as a start:

  • start here with curriculum as a review
  • look at the rules in the instructions and solve each of them one at a time.

Hopefully this helps .

-Happy coding :grin:

The exercise is asking you to write the updateRecords function, which currently only has one line - the return statement.

The purpose of the updateRecords function is to modify the recordCollection object, and then return that object.

Do the exercise one step at a time. Go point by point. Start with these instructions:

  • If prop isn’t tracks and value isn’t an empty string, update or set that album’s prop to value.

Write the logic to accomplish that, and then test it by calling the function. You can see if you’re right by console logging the object.

Once you’ve finished that first instruction, go to the next bullet point, and keep going until you finish all the instructions.

Once you’re done, see if you can refactor your function to make it more efficient.

Hope that helps.

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