...spread operator and rest operator - Beau teaches JavaScript

  Рет қаралды 152,190

freeCodeCamp.org

freeCodeCamp.org

7 жыл бұрын

The spread operator (...) spreads out the elements of an array (or iterable object). The rest operator condenses elements. The spread and rest operators are great additions to ES6!
🔗 Code: codepen.io/beaucarnes/pen/EWab...
🔗 More info: developer.mozilla.org/en-US/d...
Beau Carnes on Twitter: / carnesbeau
⭐JavaScript Playlists⭐
▶JavaScript Basics: • JavaScript Basics Course
▶Data Structures and Algorithms: • Data Structures and Al...
▶Design Patterns: • Design Patterns - Beau...
▶ES6: • ES6 - Beau teaches Jav...
▶Clean Code: • Clean Code - Beau teac...
-
We're busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.
Join our community at freecodecamp.com
Read great tech articles at medium.freecodecamp.com

Пікірлер: 171
@abraaoazevedo5077
@abraaoazevedo5077 5 жыл бұрын
"use your code for good" - loved it
@milleniummoses
@milleniummoses 5 жыл бұрын
Thank you. These aren't well explained as I was going through the exercises on the website. I came here looking for better understanding.I get them now. Very useful.
@pra__bhu
@pra__bhu 5 жыл бұрын
Totally agree to you man :D.. Makes much more sense in the video
@SanthanamSridharan
@SanthanamSridharan 4 жыл бұрын
Same!
@azizmejri4850
@azizmejri4850 4 жыл бұрын
totally agree ! they didn'te xplain how to copy the array, they just said "const spreaded = ...arr; // will throw a syntax error" which confuse the hell out of u
@leeallen2521
@leeallen2521 4 жыл бұрын
Yep, they said they would go through spread & rest operators in detail later (under basic JS) but they didnt. So glad Im not the only one :)
@kelvinmwendwa
@kelvinmwendwa Жыл бұрын
Haha. Same
@andreagirardi833
@andreagirardi833 5 жыл бұрын
Thank you. The FCC exercise had poor explanation and the concept here is well expanded and is clear. Thumbs up!
@justaprogrammer3764
@justaprogrammer3764 5 жыл бұрын
i find the real only curriculum is very confusing at times and speed up. This did also help me.
@panthonyy
@panthonyy 2 жыл бұрын
I just found the series "Beau teaches JavaScript," and boy, this is the best JavaScript tutorial series (at least about the topics covered). He is straight to the point, has a clear and clean voice that is easy to understand, and uses a good speech pace. Well, anyway, You got a new sub with notifications on ;)
@Makebuildmodify
@Makebuildmodify 5 жыл бұрын
Why is this video not embedded in the ES6 "rest" and "spread" pages!!??
@oufcena5092
@oufcena5092 4 жыл бұрын
Get a hint will get you here ;3
@EminoMeneko
@EminoMeneko 3 жыл бұрын
I love this. Clear, not excessively long, right to the point.
@sourandbitter3062
@sourandbitter3062 6 жыл бұрын
Love your voice and your straightforward explanations Beau. Very good tutorials.
@pavXX
@pavXX 5 жыл бұрын
Thanks for the explanation. The FCC exercise explanation sucked.
@Nyah420
@Nyah420 5 жыл бұрын
Harsh but accurate.
@richardl802
@richardl802 4 жыл бұрын
Great - thanks for your help in understanding this. Useful to see the different use cases explained together.
@amwostan6505
@amwostan6505 2 жыл бұрын
Thanks Beau. I was stuck on the FCC lesson about REST parameters and this really explained it well.
@deepeshsingh923
@deepeshsingh923 2 жыл бұрын
Straight forward and useful explanation. Pretty helpful.
@rnmatsuda
@rnmatsuda 3 жыл бұрын
This is extremely helpful and well explained. Thank you, Beau!
@SanthanamSridharan
@SanthanamSridharan 4 жыл бұрын
Thank you! This is superb addition to the website tutorial!
@milanm9907
@milanm9907 5 жыл бұрын
Crystal clear, thank you Beau!
@Amine-wp6de
@Amine-wp6de 2 жыл бұрын
Thanks for the clear and precise explanation of the 3 dots !
@phillipscards
@phillipscards 7 жыл бұрын
Thanks for such a great explanation. Helped me make some sense of it.
@bran8370
@bran8370 5 жыл бұрын
Great! You explained this well and made it easy to understand. I loved all the examples--really nailed it down for me. Thanks~
@vijaykumarreddyalavala3713
@vijaykumarreddyalavala3713 4 жыл бұрын
Thank you so much for this video. Short and well explained
@bk-entertainz7081
@bk-entertainz7081 3 жыл бұрын
Wow! You made this so simple. THANK YOU!!!
@girlandhercomputer7204
@girlandhercomputer7204 5 жыл бұрын
Thank you, your explanation is very clear and to the point!
@mohd0606
@mohd0606 2 жыл бұрын
Thanks, man a quick and concise video. Now the concept was clear. Kudos to you. :)
@lackadaisicallass9041
@lackadaisicallass9041 7 жыл бұрын
Very interesting! Can't wait to use it. Thank you!
@d0m2288
@d0m2288 4 жыл бұрын
Concise and informative. Much appreciated.
@ahmad-ali14
@ahmad-ali14 4 жыл бұрын
this is the best explain for those methods. many thanks.
@khajahussainpathan1064
@khajahussainpathan1064 4 жыл бұрын
Thank you, Very good explanation. Understood clearly about Spread and rest Operator
@asfandiyar5829
@asfandiyar5829 10 ай бұрын
Awesome! Exactly what I was looking for. Clear explanation. Thanks
@aceborja1656
@aceborja1656 Жыл бұрын
Thank you. Very useful explanation. Great job Beau!
@vladislavbarbarii2089
@vladislavbarbarii2089 5 жыл бұрын
Just excellent explanation.Thank you
@Ninethepoet
@Ninethepoet 3 жыл бұрын
Thank you thanks you thank you. I was stuck after getting about 50% progress and I needed to redo the whole course because my fundamentals were wrong.
@MrWardo2009
@MrWardo2009 2 жыл бұрын
Thank you for doing these videos! Really helped me !
@atifworld
@atifworld 2 жыл бұрын
so easily explained, thank you
@DelicatelyStunning
@DelicatelyStunning 6 жыл бұрын
Thank you for this video. I spent way too long trying to decipher the documentation at MDN.
@daniamsalem
@daniamsalem 4 жыл бұрын
Very simple explanation, thank you very much
@Zakyrie
@Zakyrie 7 жыл бұрын
Really nice. I'll be using your videos as a reference point.
@deaddoomed2380
@deaddoomed2380 6 ай бұрын
so simple, so useful and so badly explained. this video made it much more clear for me, thanks!
@adarshtiwari7395
@adarshtiwari7395 2 жыл бұрын
Concise and to the poin! Thanks a ton
@GeorgeEmad
@GeorgeEmad 5 жыл бұрын
clear and simple and to the point amazing
@santhoshnatarajan5271
@santhoshnatarajan5271 5 жыл бұрын
Thank you for the clear explanation
@herolivesnu
@herolivesnu 2 жыл бұрын
Wow! You did a great job here in your explanations. I can't just pass without saying "God will continue to bless you with more knowledge".
@yufeizhan726
@yufeizhan726 2 жыл бұрын
So good. Highly recommended!
@00733adnan
@00733adnan 3 жыл бұрын
Awesome. Simple and meaningful.
@hyejungk.6234
@hyejungk.6234 5 жыл бұрын
amazing tut! appreciate a bunch!
@kodave
@kodave 7 жыл бұрын
Again, thanks for the succinct explanation
@Akephalos204
@Akephalos204 Жыл бұрын
clear as crystal, thanks
@Shmack_
@Shmack_ 6 жыл бұрын
Great tutorial thank you!
@alexlions8633
@alexlions8633 2 жыл бұрын
thanks )) you are one of the best teaacher in js in the world
@stackdevlopr
@stackdevlopr Жыл бұрын
explained beautifully!
@grandpowr
@grandpowr 6 жыл бұрын
Legit the best Javascript teaching series in youtube!
@grantlineful
@grantlineful 3 жыл бұрын
Great explanation! Thank you.
@diegoavendanohernandez9908
@diegoavendanohernandez9908 Жыл бұрын
Thank you much, super clear
@andrewtcoder
@andrewtcoder 2 жыл бұрын
Thank you for this video!!!
@eminm6383
@eminm6383 4 жыл бұрын
Great, clear explanation. Well done. 🙏 thnaks a lot
@devjeff3192
@devjeff3192 4 жыл бұрын
Beau is awesome teacher !!! But I couldn't find any video tutorials regarding to ES6 on freeCodeCamp ! But finally found 'em on KZbin ! :)
@pepsivanilla93
@pepsivanilla93 3 жыл бұрын
Great explanation thanks so much
@BlueIceAce2015
@BlueIceAce2015 5 жыл бұрын
Great explanation, thanks!
@iVuDang
@iVuDang 3 жыл бұрын
Thank you, very helpful!
@buddha0004
@buddha0004 5 жыл бұрын
Thanks...I'm in the middle of these exercises for the FCC javascript cert now; Sometimes the directions aren't clear to me or confusing...(visual learner, I guess).
@lalaithan
@lalaithan 5 жыл бұрын
Excellent presentation.
@nebojsapavlovic8031
@nebojsapavlovic8031 2 жыл бұрын
Thanks Beau! This I understand.
@ih4722
@ih4722 4 жыл бұрын
Simple yet powerful.
@zeroxcrusher
@zeroxcrusher 5 жыл бұрын
Thanks! ES6 course is so badly made, so this helps.
@soygeekgirl
@soygeekgirl 4 жыл бұрын
Genial , super bien explicado!! ..
@user-kn4oi9oh4i
@user-kn4oi9oh4i 3 ай бұрын
Thank you for this Bo
@akagragupta9968
@akagragupta9968 5 жыл бұрын
well thank you so much , I was earlier just so confused now I am clear
@LuisMorales-yx8di
@LuisMorales-yx8di 4 жыл бұрын
Thanks, really helpful
@miaprivate9742
@miaprivate9742 3 жыл бұрын
It was an awesome explanation for rest of my life
@igudy
@igudy 7 ай бұрын
Thank you!
@teenytinytoons
@teenytinytoons 3 жыл бұрын
Beau is my hero!
@stavroskefaleas6320
@stavroskefaleas6320 2 жыл бұрын
Omg.This is awesome!
@ohiwantyoutobelieve
@ohiwantyoutobelieve Жыл бұрын
Excellent, ty
@CameronPak
@CameronPak 5 жыл бұрын
Now I know how to spread... Woo!
@israeli_soldier
@israeli_soldier 2 жыл бұрын
Excellent video
@canerates6180
@canerates6180 7 жыл бұрын
thank you so much! :)
@braulioandre2918
@braulioandre2918 3 жыл бұрын
When passing elements of an array as arguments to a function, we can also use destructuring assignment: function ( [x, y, z] ). In this case when we call the function we don't need to use the spread operator...
@deathknell1970
@deathknell1970 2 жыл бұрын
u are a great teacher
@kenbinta2246
@kenbinta2246 3 жыл бұрын
Well Explained. I did not have to watch the video twice to understand
@CHAZZA2010XP
@CHAZZA2010XP 5 жыл бұрын
perfectly explained
@solaraproject3614
@solaraproject3614 8 ай бұрын
Thank you
@eledorusso
@eledorusso 2 жыл бұрын
the best tutorials
@MatthewChenIsAwesome
@MatthewChenIsAwesome 4 жыл бұрын
also a nice tip with spread operator: if you're using react, instead of passing props like: ``` render() { const {key, title, summary, imageURL} = this.state; return ( //some stuff //other stuff } ``` you can do: ``` render() { const {...myComponentProps} = this.state; return ( //some stuff //other stuff } ```
@oufcena5092
@oufcena5092 4 жыл бұрын
I still haven't finished JS yet so, maybe I'll get it later. thx tho ;3
@mackynyxz
@mackynyxz 3 жыл бұрын
Nice explanation
@mmbower1
@mmbower1 6 жыл бұрын
THANK YOU
@KhaledElkhawaga
@KhaledElkhawaga 7 жыл бұрын
This is super cool.
@lecanhduong7646
@lecanhduong7646 6 жыл бұрын
so good !
@MohsinKhan-wv3ep
@MohsinKhan-wv3ep 7 ай бұрын
Best video i have ever watched ❤
@DColls2488
@DColls2488 3 жыл бұрын
GREAT VIDEO FOR ROOKIE CODERS 🙏
@RobsonAlvesJJ
@RobsonAlvesJJ 2 жыл бұрын
thank you.!
@Eriksonmagno
@Eriksonmagno 5 жыл бұрын
Awesome!
@irvingdelgado6426
@irvingdelgado6426 4 жыл бұрын
OH great, it's so useful!
@Moorcheh
@Moorcheh 4 жыл бұрын
VERY fluid explanation thanks FCC! Btw the excersizes' explanation needs a change!
@ememmenor689
@ememmenor689 5 жыл бұрын
thank you so much... :)
@jt.633
@jt.633 2 жыл бұрын
great explanation thank you! although the last one about the rest operator is still confusing
@ahmed_raaphat
@ahmed_raaphat Жыл бұрын
Don't forget to subscribe and remember, USE YOUR CODE FOR GOOD! Thanks for the great explanation.
@harryhoudini9292
@harryhoudini9292 5 жыл бұрын
muchas gracias
@ankitasingh2563
@ankitasingh2563 Жыл бұрын
Thanks
@oryaahmad2408
@oryaahmad2408 3 жыл бұрын
thank you.
@Sergeodessa
@Sergeodessa 4 жыл бұрын
thanks for explanation! btw, what about the rest - rest? )
@justincook8473
@justincook8473 6 жыл бұрын
What will happen if you have nested arrays? For example, [[1,2], ["three", "four"]]
@oufcena5092
@oufcena5092 4 жыл бұрын
//return [] try yourself in dev tools JS console var multiply = (multiplier, ...args) => args.map( (element) => multiplier * element ); console.log(multiply([[1,2], ["three", "four"]]));
@brunofernandes4120
@brunofernandes4120 3 жыл бұрын
Whats is this IDE that you are usina? How do you have the console on the IDE?
@davidgillis950
@davidgillis950 2 жыл бұрын
I don't understand the statment at 5:18 where you explain how you know the difference between the spred opperator and the rest opperator. They look the same to me and seem to be used the same. Perhaps I do not undersatnd what is means to be "passed into an argument as a function." Could someone elaborate?
JS Spread Operator: How It Works & Why I Love It
16:31
Colt Steele
Рет қаралды 75 М.
THIS keyword - Beau teaches JavaScript
8:48
freeCodeCamp.org
Рет қаралды 57 М.
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 3,3 МЛН
Whyyyy? 😭 #shorts by Leisi Crazy
00:16
Leisi Crazy
Рет қаралды 20 МЛН
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30
20 String Methods in 7 Minutes - Beau teaches JavaScript
7:00
freeCodeCamp.org
Рет қаралды 130 М.
Why Is Array/Object Destructuring So Useful And How To Use It
13:24
Web Dev Simplified
Рет қаралды 419 М.
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
Immediately Invoked Function Expression - Beau teaches JavaScript
3:32
freeCodeCamp.org
Рет қаралды 68 М.
Spread and REST operators in Javascript
14:00
Hitesh Choudhary
Рет қаралды 51 М.
8 Must Know JavaScript Array Methods
10:05
Web Dev Simplified
Рет қаралды 1 МЛН
Classes - Beau teaches JavaScript
8:43
freeCodeCamp.org
Рет қаралды 42 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
JavaScript DESTRUCTURING in 8 minutes! 💥
8:41
Bro Code
Рет қаралды 13 М.
JavaScript ES6 Arrow Functions Tutorial
9:32
Web Dev Simplified
Рет қаралды 816 М.