JS Spread Operator: How It Works & Why I Love It

Sdílet
Vložit
  • čas přidán 22. 07. 2024
  • In this video I talk about one of my favorite ES2015 features: the spread operator. We discuss the three main use cases for spread, as well as how spread relates to immutability and tools like React.
    Find the Notes Here: www.notion.so/The-Spread-Oper...
    Coupon For My React Course: www.udemy.com/modern-react-bo...
    If you're ready to launch your career as a software engineer, check out my job-guaranteed bootcamp with Springboard: springboard.com/workshops/sof...
  • Věda a technologie

Komentáře • 260

  • @swanand1161
    @swanand1161 Před 4 lety +5

    Awesome video!
    One thing I would like to state which may be handy to anyone reading:
    When we have two different objects with the same “key” the new object overrides the key of the previous one.
    for example :
    const lion = {"big":"cat",legs: 4};
    const eagle = {"big":true, "type":"bird"};
    case 1:
    const someobj = {"name": "Swanand", ...lion, ...eagle};
    this will print
    someobj = {name: "Swanand", big: true, legs: 4, type: "bird"}
    case 2:
    const someobj2 = {"name": "Swanand", ...eagle, ...lion};
    this will print
    {name: "Swanand", big: "cat", type: "bird", legs: 4}

  • @yuhceeofficial
    @yuhceeofficial Před 5 lety +125

    I enjoy your videos, notes, humor, you, your pets, everything about you. Thanks for clarity in teaching and always simplifying concepts.

    • @ColtSteeleCode
      @ColtSteeleCode  Před 5 lety +5

      Thanks Egbo, I really appreciate it. Let me know if there any topic you'd like to me cover!

    • @yuhceeofficial
      @yuhceeofficial Před 5 lety +8

      Thanks so much for replying me, i took your web developer course last year and it gave me a great perspective into understanding JavaScript and till date all i know and are in programming is all down to you. Your only courses i don't have now is the ones you're still working on. You're my hero and i sincerely want to grow and help people like you do someday.
      I am still learning but think that what will help me most now is ways to land my first job. If you can do anything along that line of how am going to go about it, I'd appreciate it so much. Algorithms scare the Shit out of me to even but am improving everything with your algorithm course. Thanks.

    • @gitarthakashyap8519
      @gitarthakashyap8519 Před 4 lety

      @@ColtSteeleCode where can i get more notes like this

    • @nostalgiccringeallhailchel3881
      @nostalgiccringeallhailchel3881 Před rokem +1

      It's called having a crush

  • @Mitsunee_
    @Mitsunee_ Před 5 lety +25

    as someone who constantly relies on MDN having additional notes/documentation on anything, especially if written by someone who knows what they are talking/writing about, is invaluable.

  • @pcost
    @pcost Před 4 lety +1

    So it is the first time ever (since 2006) that I see a video on CZcams with over 1000 likes (and I was the 1000th!!) and zero dislikes. That really means something about you, Mr. Steele. You rock! Keep doing it.

  • @Frest99
    @Frest99 Před 3 lety

    I don't understand too much when anyone speaks in English but you are very clear. Thank you for the explanation!

  • @emmanuelfabiani8435
    @emmanuelfabiani8435 Před 3 lety

    Colt Steel is synonim of clarity, professionalism and solid knowledge which is passed on in the most gracious way! Thank you for all you do and for your notes, they are brilliant!

  • @skepticacid
    @skepticacid Před 4 lety +6

    Gosh, this is so thorough and well-paced. The only explanation I needed. Thanks Colt!

  • @josiahbaumgartner7643
    @josiahbaumgartner7643 Před 4 lety +2

    I was having a hard time understanding spread from the MDN documentation so I looked for a video explaining it. This one wasn't the first on the list but it looked like it was the highest quality one on the first page so I clicked it and I'm really glad I did! This video was great and I feel like I understand spreads very well after just one watch!

  • @Justin73791
    @Justin73791 Před 2 lety +2

    Just want to say, this is an awesome tutorial with a ton of effort behind it. Well done!

  • @marlynch
    @marlynch Před 5 lety +1

    Grateful for the video, and appreciate the notes, too. The MDN explanations are often dense and inscrutable, and I'm glad you take the time to deconstruct the definitions and explain them in ways I grasp rapidly. Completed your Web Developer Bootcamp course and was amazed at how well you explained and demonstrated everything. Next up: the Advanced course! Thanks for all of it, Colt!

  • @lalosalamanca1208
    @lalosalamanca1208 Před 2 lety +1

    The "Spread Eagle" reference had me rolling. Great video. Very informative! Thanks again for all you do for the coding community!

  • @christinavoudouris
    @christinavoudouris Před 4 lety +1

    Thank you Colt - fantastic video! Great balance of showing practical examples and explaining the "why" behind everything. I bookmarked your notes too :)

  • @armaanpathan1856
    @armaanpathan1856 Před 4 lety +2

    Hey Colt, just getting addicted to your teaching dude !! Thank you for the amazing contents you create for us .

  • @mariiatkachova570
    @mariiatkachova570 Před 4 lety

    Your videos are great! Keep up! I like that you show how well-rounded you are by mentioning art and TV-shows!

  • @harrazmasri2805
    @harrazmasri2805 Před 2 lety

    i was stunned the first time i saw this before a competition, took me months more to fully grace everything

  • @ga7853
    @ga7853 Před 5 lety +1

    I think you are the best one who explained the spread operator, Thank you so much for this tutorial

  • @magdasokolovic
    @magdasokolovic Před 3 lety

    the best explanation of spread operator I've seen. Thanks for the great content

  • @umangbhatnagar1415
    @umangbhatnagar1415 Před 3 lety

    Oh Lord you are the best. I bet no one ever has over the entire web explained to that detail the damn spread operator... Thanks a lot, you made my day!! job well executed!!

  • @riyadhossain1706
    @riyadhossain1706 Před 2 lety

    the notes are really helpful, please don't stop making notes. Thank You

  • @thomjorke
    @thomjorke Před rokem

    oh my goodness, I have done two full React courses and have always been so confused by the spread operator. Have watched many other videos and read documentation that did not click but your video really solidified it! THANK YOU

  • @Rino37
    @Rino37 Před 4 lety

    Thank you for this informative video. As a new programmer currently drinking from a firehouse in a boot camp, I found this very helpful.

  • @DUANEYAISER
    @DUANEYAISER Před 5 lety +9

    Thank you! Just an hour ago, I was using your boot camp lessons to add flash to my own project. :-)

  • @growthascendant4689
    @growthascendant4689 Před 2 lety

    Delightfully informative is how I describe your teaching style. I'm learning a lot and I'm laughing a lot. Great stuff. 💯

  • @mocktarissa
    @mocktarissa Před 4 lety

    A video without dislikes on youtube. This shows how much we needed it. Thanks Colt

  • @ts3798
    @ts3798 Před 4 lety

    You are easily the best online teacher out there.

  • @DavidVCastro
    @DavidVCastro Před 2 lety

    I saw the spread operator being used in Maximillian Schwartzmuller's Ionic Udemy course, and tried to read an explanation of it. That wasn't working, so I found your video, and you cleared it right up for me! Thank you!

  • @amymerrill5815
    @amymerrill5815 Před 5 lety +2

    Love your videos and teaching! I am taking your js course. Looking forward to your react course. I appreciate your notes! Thank you for all your hard work!

  • @CraftishFX
    @CraftishFX Před 5 lety

    Really love your courses and videos Colt! Also i find the notes very helpful, please keep making them.

  • @kentaasakura8230
    @kentaasakura8230 Před rokem

    First time watching one of your tutorials, and I found your tutorial easy to understand. Thank you for contributing in the developer society 🙏

  • @joanclarke2724
    @joanclarke2724 Před 5 lety

    Thanks for the video, it simplified the spread operator concept a great deal for me and I really appreciate your thorough notes.

  • @GermanBlueMax
    @GermanBlueMax Před 3 lety

    I was laughing at your speed reading of the MDN definition.
    That is exactly how I felt when I went to read about spread syntax initially lol

  • @joshualawson7604
    @joshualawson7604 Před 4 lety

    I haven't seen anyone explain this as well as you have. Great job!

  • @andreirobert18
    @andreirobert18 Před rokem

    You are the best teacher there is! Thanks for making my life better!

  • @souptiksarkar3636
    @souptiksarkar3636 Před 3 lety

    Your notes are super useful, please keep writing them.

  • @mohammadhoque2295
    @mohammadhoque2295 Před 4 lety

    I don't know why someone disliked this (2 people)? This is a great explanation and comes with the blog post to reference later. Obviously Colt put time and effort in this for others to understand this concept. I really like that you have the notes for me to reference later on. I will reference your video on my blog. Thank you for the nice video.

  • @comrade4664
    @comrade4664 Před 2 lety

    Thank you, very complete guide and even managed to help me understand react, which I am studying right now

  • @gfmoore
    @gfmoore Před 2 lety

    Fantastic. Wonderfully easy to understand explanation and delivery. Top man.

  • @alexotoous
    @alexotoous Před 2 lety

    you are one of my best teachers in web development. I would love to see more of your teachings on youTube. I have most of your Udemy courses

  • @teenytinytoons
    @teenytinytoons Před 3 lety

    definitely one of your best videos colt. great explanation with good examples and good pacing.

  • @Nicole-cs2vz
    @Nicole-cs2vz Před 3 lety

    This was an excellent explanation. I needed something to supplement the es6 lessons on freeCodeCamp, and this video did the trick!

  • @damin1916
    @damin1916 Před 2 lety

    I love that you use a lot of examples, really helped a lot!!!!

  • @shashanksshetty9870
    @shashanksshetty9870 Před 5 lety +1

    Great videos, liked the important and covered all most all aspect of spread operator. Hoping for more such videos in future.

  • @cubedev4838
    @cubedev4838 Před 4 lety

    Seriously i love this kind video :) i always have problem with this operator especially in react...thanks a lot. Really nice video when u can simplify that common confusion :)

  • @satheshkumar5906
    @satheshkumar5906 Před 3 lety

    thank you, its always nice to have the notes part for reference

  • @RahulSharma-oe6fy
    @RahulSharma-oe6fy Před 2 lety

    Thanks Colt! It's one of the most extensive video on the topic. Helped me a lot!

    • @RahulSharma-oe6fy
      @RahulSharma-oe6fy Před 2 lety

      I have bought the react course too from Udemy . Can you update it to the latest version ? Facing some issues with projects

  • @powerup4016
    @powerup4016 Před 4 lety

    Thank you for this video. Helped me grasp why two inputs using the same useState need a spread op ... for the onChange event in the setState(...state, e.target.value). Going to have to go back and see if you cover it in your React Course. Thank you again!!

  • @robertjohnstevens
    @robertjohnstevens Před rokem

    Excellent explanation of the Javascript spread operator. Thank you very much!!!

  • @AndresMenaSimba
    @AndresMenaSimba Před 5 lety +7

    Please keep making videos like this. Extremely helpful.

  • @alexander5052
    @alexander5052 Před 3 lety

    Nice! After 5 minutes watching everything got much more clear. Thank you!

  • @dieegocastrof
    @dieegocastrof Před 4 lety +1

    Hey Colt! :)
    Just letting you know that your explanations are super clear! Thanks for that.
    Also, the Notions notes ARE SUPER USEFUL! I can attach them to my own Notion that I'm building about JS so I have quick access to them, I know they should take time, but if you can keep doing them in your videos would be GREAT !!
    Thanks again :)

  • @zdargahi
    @zdargahi Před 2 lety

    hey Colt. I love the Notion notes. Thanks for awesome video

  • @WrestlingTournamentsDotCom

    Very helpful. I've tried to learn spread a few times, but I think this will still now, thanks.

  • @bits_of_bryce
    @bits_of_bryce Před 5 lety +4

    Colt you are incredible. Honestly, I wouldn't use the notes over quickly searching for an example.

  • @balajeemishra
    @balajeemishra Před 2 lety

    This video is one of the best video I found on CZcams.. Please make this type of videos.😊

  • @J3ffMusk
    @J3ffMusk Před 4 lety

    Thumbs up just after 1min due to the notion notes. Love the idea!

  • @marina3451
    @marina3451 Před 5 lety +1

    Quite frankly, I only used the notes from your regex video and to my mind such cheat sheets turn out to be super useful. If you don’t feel like spending time preparing these notes, it’s absolutely fine - I think we will manage without them, however, as I mentioned, with topics such as regular expressions where there is quite a lot of new ideas to learn - they really come in handy.

  • @russaanderson
    @russaanderson Před 5 lety +3

    Thanks - this is great information! YES, the notes are very helpful - keep up the good work!

  • @danielbroe5390
    @danielbroe5390 Před 4 lety

    Keep them notes coming! Helping me a lot.

  • @jsblade2770
    @jsblade2770 Před 2 lety

    you cleared up all the confusion in my brain, great explantation tahnk you!

  • @saileshthapa5970
    @saileshthapa5970 Před 4 lety

    Coming directly from your react bootcamp to have more understanding of spread operator and notes helps(actually saved it as well ^_^)

  • @chips-n-salsa
    @chips-n-salsa Před 2 lety

    thank you for this video. spread operator makes a lot of sense now

  • @dndLeitch
    @dndLeitch Před 3 lety

    bro you are really good at this keep it up, it is helping me loads!

  • @tn9753
    @tn9753 Před 3 lety

    Really helpful video and the use cases made it more clear. I did start to veer off at 11'13'' at the React discussion. Anyways, thank you.

  • @lemueljunior
    @lemueljunior Před 4 lety

    Best spread operator tutorial ever! Thanks for sharing your knowledge in a simple and easy to understand way. =)

  • @panagiotiszig6228
    @panagiotiszig6228 Před 5 lety

    colt you have saved my miserable life,thank you from the bottom of my heart!

  • @carolinazamora9004
    @carolinazamora9004 Před 2 lety

    I understood this thanks to you, thank you for being so clear and thorough !

  • @firstworldproblems5477
    @firstworldproblems5477 Před 5 lety +1

    The notes are great. They are very useful. Thanks for all of your content.

  • @sexyeur
    @sexyeur Před 5 lety

    Can also inexpensively _gift_ Colt's exhaustive self-paced course to someone you know... _Highly_ recommended.

  • @igornikonov9641
    @igornikonov9641 Před 4 lety

    Simply an awesome video :)) Lots of new useful information delivered in a concise and entertaining way.

  • @VladimirJovana
    @VladimirJovana Před 4 lety

    Thanks Colt, beautiful and dead easy to understand&implement explanation!

  • @angelmgl8137
    @angelmgl8137 Před 3 lety

    Nice explanation, i'm from Paraguay, my english is bad, but i can understand you 80%
    New sub, great content

  • @pauldolton9118
    @pauldolton9118 Před 5 lety +1

    Hi Colt, always grateful for your videos, I would not use the notes personally, I would rather have a visual and audible explanation like you have done here on youtube. Many thanks for all the effort and time you put into your work.

  • @OzoneGamerStation
    @OzoneGamerStation Před 5 lety +1

    You should communicate with the community more often through Q&As, WDB Facebook page, and whatnot. You seem like a celebrity who pops up once in a while where we just communicate to your TAs. Would love to ask the Big Cheese some questions and whatnot.

  • @ricardorien
    @ricardorien Před 3 lety

    Hey man, thanks for your notes and video! greetings from Venezuela.

  • @duuhhveeed
    @duuhhveeed Před 5 lety +8

    I’m working on a react final project for a boot camp and this gave me some really good pointers, concise as always Colt!!

    •  Před 4 lety

      Can i ask you which bootcamp you are in ? and are you happy with the education they gave?

    • @duuhhveeed
      @duuhhveeed Před 4 lety +1

      I went to a trilogy camp at UT Austin and it was pretty good I learned more then I would have on my own but they need to work on prices cause it was pricey being also the cheapest at 12k. I got a job 2 mo afterwards it’s not big pay but a start. I suggest going in with some knowledge prior. Hope this helps!

  • @kiyahp12
    @kiyahp12 Před 3 lety

    Your notes are very helpful. Thanks for the video!

  • @animanoir
    @animanoir Před 4 lety

    the first example is amazing. thank you.

  • @mrinaltewary
    @mrinaltewary Před 3 lety

    Your Notes are awesome................ keep helping us......

  • @ninjachickn
    @ninjachickn Před 5 lety +1

    Not only do I love Notion, but the notes are very helpful

    • @ColtSteeleCode
      @ColtSteeleCode  Před 5 lety

      I'm obsessed with Notion! Love that it supports code syntax highlighting and embedded gists. I wish I was on the Notion dev team :)

  • @RaajKanchan
    @RaajKanchan Před 4 lety +3

    10:48 Take a bow! You nailed it. Thank you for sharing...

    • @BobbyBundlez
      @BobbyBundlez Před 3 lety +1

      or smoke a bowl! You earned it! 420 blaze it brooooooo :)

  • @gkmchardy4
    @gkmchardy4 Před 3 lety

    Notes are VERY useful and much appreciated.

  • @warlock257
    @warlock257 Před 4 lety +8

    This greatly clarifies an unknown I've had in my head for months.

  • @andrenireri5252
    @andrenireri5252 Před 4 lety +1

    This solves a lot of problems for me. Thank you!

  • @espinozaja81
    @espinozaja81 Před 3 lety

    awesome video i also like the notes. makes it really easy to reference the material

  • @0xMaw
    @0xMaw Před 3 lety

    Borderlands references in a JS video, that was unexpected. Nice one!

  • @mohamadomran13
    @mohamadomran13 Před 5 lety +10

    Great job dude! p.s: the notes are really helpful, so please don't ditch them :P

  • @ricardotlatelpa8868
    @ricardotlatelpa8868 Před 4 lety

    Thanks Colt Steele super helpful! bought your React Bootcamp too!

  • @jamesmassa1999
    @jamesmassa1999 Před 3 lety

    Very well done, and the notes are a great additon!

  • @chamnil8666
    @chamnil8666 Před 4 lety

    Thank you so much sir,this is really helpful,i read the article too,so useful,thanks again.

  • @voltairinedecleyre
    @voltairinedecleyre Před 4 lety

    Thank you! The notes are great, way better than MDN

  • @wazzadev7209
    @wazzadev7209 Před 4 lety +1

    Thanks for this i've been learning react lately and this just clarified a lot

  • @eduardocarvalho4232
    @eduardocarvalho4232 Před 3 lety

    Very good explanation!
    Thank you, the notes helped a lot :D

  • @bobbydonchev2217
    @bobbydonchev2217 Před 5 lety +1

    Dude you are awesome, please keep the notes!

  • @mattunlu8916
    @mattunlu8916 Před 4 lety

    I liked the way you explain about everything. Please add advanced react projects. Tnx lot

  • @snowfall1984
    @snowfall1984 Před 3 lety

    Thank you. Very clearly explained the spread operator.

  • @roshanbhusal2505
    @roshanbhusal2505 Před 3 lety +1

    I was so confused, this helped a lot.

  • @maheromri4587
    @maheromri4587 Před 2 lety

    First time i see your videos then i should subscribe ... amazing explanation

  • @kal5211
    @kal5211 Před 2 lety +1

    Notes were helpful! Thank you!

  • @marcelnunez1658
    @marcelnunez1658 Před 4 lety

    Love your style of teaching, subbed

  • @justingilley5017
    @justingilley5017 Před 4 lety

    I subscribed partially because you said "... do all of that annoying stuff". I like the realism: good video.