Vanilla JavaScript Challenge (Working with Objects)

preview_player
Показать описание
Ready to test your JavaScript skills? I've got 14 challenges for you all about JavaScript array and object methods!

🔗 Key Links 🔗

📹 Related Videos 📹

🔗 Other Links and Details 🔗
- Theme: Palenight Operator

---------------------------------------

⏲️ Timestamps ⏲️
0:00 Introduction
3:43 Easier Challenges
9:04 Harder Challenges

---------------------------------------

🌐 Connect With Me 🌐
Рекомендации по теме
Комментарии
Автор

Harder challenge #3, I forgot to only return strings. Sorry! So after the sort, I’d map through the resulting array returning only the text property of each item in the array.

CodinginPublic
Автор

I was trying to use a for of or for in loop for the first one under comments. Did not think to use Object.values. I hope you do more videos like this. Trying to solve them first, and then seeing you solve them finally gets me motivated to up my js chops.

JimKernix
Автор

So good! Thanks a lot!
I would like to see another one with more complex nested arrays and nested objects!

skapha
Автор

Great video. I really struggled on the harder challenges. But thats a good thing.

RocoSafreti
Автор

Thanks, man!!!! Learning a lot!
Abraço do Brasil!
God bless!

viniciusm.m.
Автор

Another great challenge Chris 🚀
For harder challenge, question 4 we could simplify the usage of reduce by using just map like :
const commentObj = Object.entries(comments).map(([id, comment]) => {
return { [id]: comment.text };
});

What do you think about it ? :D

jimmyj.
Автор

Number 5 is really complex.... But it's good for learning 👍 make more videos to open our mind and build our logics strong... Also, we have not been focusing on such things because of ChatGPT but in interview coding rounds, we get totally stuck... So make a video on that approach as well like present scenarios ij presence of ChatGPT.

kashmirtechtv
Автор

plz add this to the ' Vanilla JavaScript Challenge ' playlist

theMadZakuPilot
Автор

Were you supposed to also add on a .map for sortedCommentsArray? It sounds like the array is just supposed to be an array of strings and the actual comment is the only string in each object.

JimKernix
Автор

Why did we wrap key with square brackets [ ]?

kashmirtechtv
Автор

Thanks for the video! Never understood the reduce function before watching your video.
For harder challenges 7, instead of reduce reduce the comments object, I reduce the peeps and filter the user's comment inside.
I think the result is the same but curious is there any difference on performance?

const groupedPeepComments = Object.values(peeps).reduce((acc, p) => {
const key = `${p.name.first} ${p.name.last}`;
const pComment = => c.userId === p.id)
return { ...acc, [key]: pComment }
}, {}) //?

johnsondev
Автор

For Harder 4:
let commentObj = {}
for(let commentId in comments){
const comment = comments[commentId];
commentObj[commentId]= comment.text;
}

ajaydeepsinghrajpoot
Автор

Ah yes.... He's getting close....

I'm waiting for when he does regex

DanteMishima
Автор

I think i have to work more on reduce method practice.

kashmirtechtv