Record challenge

please i need help on how to use if...else if to solve this challenge.i’m completely drown in this challenge

  **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 "ABBA";

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.71 Safari/537.36 Edg/97.0.1072.55

Challenge: Record Collection

Link to the challenge:

It doesn’t look like you’ve tried anything yet.

Let’s back up.

First step - what do the arguments to this function mean?

What is records?

What is id?

What is prop?

What is value?

honestly i dont know

Ok, well can you guess? How could you experiment and find out?

Here is what the challenge says:

You start with an updateRecords function that takes an object literal, records , containing the musical album collection, an id , a prop (like artist or tracks ), and a value . Complete the function using the rules below to modify the object passed to the function.

something like this?? function updateRecords(id, prop, artist, tracks) {
and then return the value??

Ok, you don’t seem to be interested in my approach and we aren’t really on the same page here so I’ll let someone else try to help.

how do you mean i am not interested on your approach?? i need help!!

He was picking your brain to try and help get your gears ticking to solve this problem. We want to help you without just giving the answer.

There is often a dozen ways to solve a problem.

Check this article out JavaScript If-Else and If-Then – JS Conditional Statements to learn about different ways of using conditionals in JS.

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