JavaScript spread operator and rest parameters tutorial ES6 / ES2015

preview_player
Показать описание
Understand new features of JavaScript ECMA6 - spread operator and rest parameters.

The spread operator allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) are expected.

- What is spread operator
- Benefits of using spread operator
- Improving performance using spread operator
- Passing spread operator as a function parameter makes it rest parameters.
- Using spread operator in arrays

#JavaScript #SpreadOperator #restParameter
*My Udemy Courses

Follow me for technology updates

Help me translate this video.
Рекомендации по теме
Комментарии
Автор

Perhaps you might want to also include below syntax too for merging arrays, assuming a and b are also arrays
var c = [...a, ...b]

akhileshguptaakhi
Автор

techsith, time and again, shows that teaching is a gift; amazing examples - and to the point. Well done! Your work, time and effort in producing them are fully appreciated.

Vivaxsolutions
Автор

'go to heaven' didn't expect that come out 😂🤣

sophialee
Автор

1.16 it is actually the rest operator in that scenario, as you are collecting unknown quantity of arguments into the new array n. Opposite use, i.e. to dismember an array, but used in a function call would be the spread operator.

Carl-yuuw
Автор

Great video - I see this operator used all over the place in projects at work. This is the best explanation I have seen! And who doesn't love toast?!

malbu
Автор

You have a great teaching style. Straight to the point and cover the major use cases real well! Thx!!

shay
Автор

3:17

You should do this with Array.from(arguments);

Also, parameters can be left out entirely if you were to do it the other way:


kazaakas
Автор

Thank you, great explanation on spread operator and rest parameter!

cynthiaclinton
Автор

I give every techsith video a thumbs up.
Always good.

threeone
Автор

ES6 is very very fucking important these days to learn frameworks.

jsnode
Автор

U re rocking..simply superb...need more am not getting why 27 dislikes...

karthigadevi
Автор

Ok, i stand corrected, that is the best thumbnail on youtube! Sheesh, i wish we were in same team!

mmmmmmm
Автор

That's amasing and really helpfull video, It's must be in top!

sup
Автор

Can't stop watching your videos, I am addicted and subscribed :D

vinkrins
Автор

the big difference between the spread operator
and the rest parameters
is actually the place in which we use each of them.
So the spread operator is used in the function call.
While the rest operator is used in the function declaration.

aseel
Автор

You remind of Dev Anand. Awesome videos as always

lloydlasrado
Автор

YouReAwesome= ["you're awesome", "best tutorial ever", "easy to follow"]; thankYou=["thank you sooo much", ...YouReAwesome]; LOL

amirkahinpour
Автор

I just stumbled upon your channel: Thank You!

RodolfoRivera
Автор

[1, 2, 3].concat([4, 5, 6])
not a big problem.

… is really usefull as deep copy operator:
b = { …a }

Acid
Автор

He can joke with a straight face ... #BigRespectSir

Amitkumar-zpwb