JavaScript Tutorial | Spread Operator vs. Rest Operator | Simple Explanation | Nirmal Joshi

preview_player
Показать описание
"..." are used as spread operator and rest parameter. In this video I am explaining the difference with examples for both.

Want to crack any regex problem effortlessly? Check out my Udemy course where you'll get

#JavascriptTutorial #SpreadvsRest #NirmalJoshi
Рекомендации по теме
Комментарии
Автор

Tried multiple videos but this video cleared this concept better for me.
Thanks 😊

mahimashukla
Автор

I've been studying JS, and I've been learning a lot. I love this video. Something I would like to add, is that if you're using it on the left side of the = operator it works as the rest pattern, but if you use it on the right side it works as spread. Please provide feedback!

const arr1 = [1, 2, 3];
const arr2 = [...arr1, 4, 5, 6];
Output is [1, 2, 3, 4, 5, 6];

But

const arr1 = [1, 2, 3, 4, 5, 6];
const [a, b, c, ...d] = arr1;

Output
a is 1
b is 2
c is 3
d is an array with the rest of the elements. So in this case, ... Creates a new array that contains the rest of the values.

justdominican
Автор

The way of speaking is very good along with explanation 👏

pankajsharma-rfov
Автор

Best explanation on Youtube! You got a subscriber for life sir...

KaranSingh-iicv
Автор

Very clean and simple. Thank you Anagh Technologies !!!

johnm
Автор

It is really helpful to me.. Thank you

nikitavaishya
Автор

No video has explained it the way you have. Thank you for the detailed explanation.

spsinghss
Автор

Super refined, with a clear explanation with toned speaking...Well Done!!

umangbhatnagar
Автор

The best understanding I've ever got crisp & clear explanation thanks a ton for this video

srinivasteja
Автор

Best explanation in this topic. Thanks a lot buddy. Keep making this type of contents.

navedahmedkhan
Автор

Straight forward and clear. Thank you!

raisedbyreels
Автор

Straight to the point and well explained. Thanks man💪

shinesackiteykoblateye
Автор

Really awesome, all confusions cleared with this video.

saishankar
Автор

Magnificent explaination🎊🎉 Most helpful...Thanks so much🎊

sangamithiranmass
Автор

Thank you so much. I get a clear concept from your video. I was so confused. Thanks again.

isharethingsiknow
Автор

thanx for the explanation was helpful.

KavindaPerera-dx
Автор

very good explanation mate you got my like n comment, hope the youtube algorithm does you good.

CodingBandit
Автор

Hi, can you give the link to the argument operator video? Thank you!

NIKETSHUKLA
Автор

Thanks vey much simplest way ever alot of thanks..

asharma
Автор

I want to create a shallow copied array. Which syntax I should use?
//Rest syntax
const [...abc] = array;
Or
//Spread syntax
const abc = [...array];

damo