JavaScript for Beginners #63 Rest Parameters

preview_player
Показать описание
Here, we will continue to look at the rest parameters and rest pattern. The rest pattern allows us to collect values and condense them into an array. When used inside of a function, our function can take an indefinite amount of parameters.

0:00 MDN rest parameters
2:06 sum function with spread operator
4:17 sum function with rest parameters
9:17 menu items function with rest parameters

JavaScript Playlist:

MDN rest parameters:

MDN Spread Syntax:

MDN Destructuring Assignment:

NodeJS:

VS Code:
Рекомендации по теме
Комментарии
Автор

Thanks! I needed some better examples than the same old add and multiply examples!

JimKernix