freeCodeCamp Record Collection Challenge JavaScript

preview_player
Показать описание

Hope it helps and thank you for watching!
Рекомендации по теме
Комментарии
Автор

Thank you for making this video. It was very helpful. I'm adding this version of the challenge here just in case someone else gets this one:


Record Collection
You are given an object literal representing a part of your musical album collection. Each album has a unique id number as its key and several other properties. Not all albums have complete information.

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.

function updateRecords(records, id, prop, value) {
if (prop != 'tracks' && value != "") {
records[id][prop] = value;
} else if (prop === 'tracks' && records[id][prop] === undefined) {
records[id][prop] = [value];
} else if (value === "") {
delete records[id][prop]
} else if (prop === 'tracks') {

} else if(value === ''){
delete records[id][prop]
}
return records;
}

danielperezrosales
Автор

THANK YOU for your clear explanation! I was getting such a headache trying to understand this lol

beinyconway
Автор

Great video! I have a question. Why do you include quotations around 'tracks' but not the value? the tracks property in the object doesn't have quotations so that's why i'm confused and also do you have to strictly equal/unequal everything?

edrikallahverdi
Автор

Great content, keep up the good work!
One tip that I think would make that video even better is to explain once more what you wrote so far and deconstruct every line you wrote one last time before ending the video.
But overall a very clean and understandable explanation of the challenge, you do have the skill of explaining!

captainanunnaki
Автор

This lesson was a giant leap forward from the last lesson. I can't figure it out on my own. Thanks for the video !

Migs-yo
Автор

Hey man, just wanted to say thanks for this video! I had really been struggling with this challenge, but this was super helpful and your clear explanation really helped to solidify my understanding!

droopyj
Автор

You look and sound like The Rock. Great videos by the way!

brandon
Автор

That was an interesting (difficult )problem.
But Thank you so much for taking your time to fully explained everything

carldjovan
Автор

Just wanted to add another "Thank you!" to the list! watching this video of yours truly just helped this click better for me! plus your voice is AMAZING :) new sub! you're an awesome teacher!
I do have a question though! after reading a couple of your responses in the comment section to other beginners (like myself) you seem to understand this so well that it makes teaching it unbelievably clear, how long did it take you to initially understand/pass this challenge? I'm still struggling admittedly :/

bridget
Автор

I couldnt do it by my own, that made me really think about If I was learning right, however, Im not going to give up.

Tomas_Gz
Автор

Hey man I’ve been struggling with code, this was the best tutorial I’ve ever seen with someone explaining this concept. Is there any way I can get in touch. Thanks!

seanmaine
Автор

Thanks man, with this video I was able to understand what was needed.

sudoPrivileges
Автор

Thank you . ) It helped me . Second option was hard for me, now it is not .

ArtemYershov-ho
Автор

Thank you for your efforts. However, I cannot understand how these object, id, prop and value are associated with the above setup in the code... if possible could you please clarify:)

yuliazeeshan
Автор

why do you write "object" if the object's name is "collection"?

shouldn't the first rule be

if (prop !== 'tracks' && values !== ' ') {
collection[id][prop] = value}

?

arbo
Автор

Thank you very much!!! You helped me very very much! I'm subscribed on your channel! You The Best!❤️👍😀

СвятославМагеровський
Автор

This kicked my ass. Thanks for the explanation

stuckinthas
Автор

thank you for video but it was a little bit hard exercise i am still confused

eToLiveIsToDie
Автор

Thank you for this helpful video. I subscribed.

procopio
Автор

can you do this lesson again this exact text in your script didn't work today but it did yesterday

slewbp
visit shbcf.ru