Record Collection - Where do I even begin?

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

Where do I even begin in solving this challenge? Sure it is very easy for me to google the answer, but then I wouldn’t learn anything. So, where do I begin?
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) {
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/97.0.4692.99 Safari/537.36

Challenge: Record Collection

Link to the challenge:

I’d start by picking just one part of the challenge. The value === "" part seems to have a really short description. Start there.

What do the instructions want you to do in that case?

The instruction for value is

  • If value is an empty string, delete the given prop property from the album.

Does that mean this code would work?

delete recordCollection.1245.tracks;

1245 tracks is empty.

Close, but id and property will always be in variables, so you need to tweak the syntax.

Also, you probably need some sort of conditional logic to make sure delete only happens when you have an empty value.

Just for the record: dot-notation cannot be used with numbers - use bracket-notation instead.
Same goes for variables.

1 Like

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