13 Destructuring via rest elements - ES6 - FreeCodeCamp Solution - JavaScript Algorithms & Data

preview_player
Показать описание
FreeCodeCamp lesson walkthrough - explained.
To assist you if you get stuck, and breakdown core concepts the material is trying to convey. Please leave a comment if you're still confused and I'll do my best to respond within 24hrs.

FreeCodeCamp - Javascript Algorithms & Data Structures Course
ES6 Sub-course
Challenge 13 Destructuring via rest elements
Рекомендации по теме
Комментарии
Автор

These videos are excellent after going through the problem (and struggling mightily first). I almost always end up using the hints and try to figure out what the answers means and sort of reverse engineers it myself. Then I come to these videos to get clarity.

Great content!

menyo
Автор

I like looking at how someone else solved it so this playlist is great. Every where I look this problem has slightly different code. This was newest example so I thought it would be the same but it has been slightly updated. Mine had no comments and 3 lines of code.
I found example of someone destructuring array directly in the argument parenthesis but it was in RUST. I tried it anyway, and dammed if it worked in JS too.

function removeFirstTwo([, , ...arr] = list) {
return arr;
}

const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const sourceWithoutFirstTwo = removeFirstTwo(source);

jared
Автор

wow, such an articulate explanation. thank you!

shannonstumpf
Автор

It never told me I could change the name behind ...arr, It would not pass the following const [a, b, ...arr] = list; let shorterList = [...arr]; =.= thank you for this tutorial.

stephenblancq
Автор

This makes more sense when you explain it😅..

shweeppsm