Map - Part 2 of Functional Programming in JavaScript

Поделиться
HTML-код
  • Опубликовано: 10 ноя 2024

Комментарии • 636

  • @SoeaOu
    @SoeaOu 8 лет назад +189

    I'am watching this from the future baby!
    We have arrow functions now, what a classy feature.

    • @LasanaMurray
      @LasanaMurray 8 лет назад

      +Hoto What a difference the make when used responsibly. :)

    • @Sage16226
      @Sage16226 5 лет назад +8

      I'm watching this from your future, lol

    • @zerg230
      @zerg230 5 лет назад +2

      @@Sage16226 I am reading you from the future, too

    • @algorithmengineer6241
      @algorithmengineer6241 5 лет назад

      You can thank .net for the popularity! I'm fairly certain that it was the first major language to release the feature and make it popular! Search .net 2.0

    • @ApexHachiRoku
      @ApexHachiRoku 3 года назад

      I'm from the future. You are correct sir.

  • @JavierPortillo1
    @JavierPortillo1 8 лет назад +394

    Man, your videos are so entertaining, I don't even notice how much I'm learning! You're a great teacher! :D

    • @ShowersWithToaster
      @ShowersWithToaster 3 года назад +1

      Completely agree! Love this series and the way he breaks things down makes it very relatable and so much easier to understand.

    • @mirandamoralez6354
      @mirandamoralez6354 3 года назад +1

      @@ShowersWithToaster Word!

  • @acur665
    @acur665 7 лет назад +54

    I love how laid back your teaching style is. Great work! My success as an engineer is purely through the gracious people of RUclips spreading knowledge. Thank you!

    • @funfunfunction
      @funfunfunction  7 лет назад +29

      Thanks a lot for the kind words, I really try to make it human, so that confirmation means a lot.

  • @fabianofrank4785
    @fabianofrank4785 3 года назад +2

    That man can still be relevant in 2021... and I love your attitude ! Cheers, man!

  • @DigitalMonsters
    @DigitalMonsters 8 лет назад +1

    Only discovered this channel the other day, now recommending it to anyone that has any interest in JavaScript.
    Loving your content and enthusiasm is always infectious.

  • @segmentationfaulter
    @segmentationfaulter 9 лет назад +88

    You are simply awesome man!!! I am really enjoying stuff from you, making 'complex' concepts pretty simple. Please keep making more videos!!! Thank you

    • @funfunfunction
      @funfunfunction  9 лет назад +27

      Muhammad Saqib Will do, thank you so much!

    • @yashnu
      @yashnu 9 лет назад +1

      +mpjme like it too.

  • @NaserMohdBaig
    @NaserMohdBaig 4 года назад +1

    Having a great teacher is such a blessing. I'd never be where I am if it wasn't for the amazing teachers like Colt Steele, Maximilian Schwarzmüller and you.

  • @knthlai
    @knthlai 6 лет назад +1

    Honestly one of the first tutorial series that shows an enthusiastic teacher as well as an entertaining humor. Both works wonderfully with each other for this channel! Keep up the great editing and content!

  • @MasterPuppets206
    @MasterPuppets206 7 лет назад +26

    var animals = [
    { name: 'Fluffykins', species: 'rabbit' },
    { name: 'Caro', species: 'dog' },
    { name: 'Hamilton', species: 'dog' },
    { name: 'Harold', species: 'fish' },
    { name: 'Ursula', species: 'cat' },
    { name: 'Jimmy', species: 'fish' }
    ]

  • @andora2985
    @andora2985 7 лет назад

    You know your teacher is awesome when you look forward to coming home and playing the videos. Keep up the great work, and thank you.

  • @smuffer852
    @smuffer852 6 лет назад

    So fun that my node.js version read this right off the bat. No problem. "If you're watching this video from the future you don't have to do this". Learning a great deal through these videos.

  • @Hichammmmmmmmmmmmmmm
    @Hichammmmmmmmmmmmmmm 9 лет назад +7

    I wonder why i've never had a teacher like you. Thanks.

  • @SpaceShot
    @SpaceShot 9 лет назад +1

    Everything about the presentation style is engaging. Many people will benefit from how patiently you break down this topic.
    The other thing about functional style is that you don't necessarily have to decode what the loop is doing, since the loop merely tells you how to do something, but not what you were doing. Sure you can comment, but comments go stale and some people are terrible at updating them. The code is the truth.
    Once you learn some basic functional style and the standard functional transformations, you think in terms of map, filter, and so on... so you see what the program is doing, and you don't really worry about how.

  • @oopsiedaisy94
    @oopsiedaisy94 5 лет назад

    i'm a student in design school and this is helping me wrap my head around functions a lot better omg thank you

  • @andreyanandreev6881
    @andreyanandreev6881 9 лет назад +83

    when there is a single parameter the arrow functions does not need the ().. so it can be x => x.name i thin, instead of (x) => { return x.name }

    • @helloken
      @helloken 6 лет назад +1

      Thank you! I was just about to ask in the comments. I'm pretty sure you're right too I just wanted to make sure. Well, suppose we could write the code and run it too to test but I'm lazy. :)

    • @kazaakas
      @kazaakas 6 лет назад +2

      This is true, and leads to even cleaner code! Woohoo!

    • @rotimibabalola8742
      @rotimibabalola8742 5 лет назад

      I almost felt like removing the extra () in his editor 😂

    • @danieldefoe2981
      @danieldefoe2981 Год назад

      You are absolutely right but all JS Linters recommend to use parentheses

  • @DaleColeman
    @DaleColeman 9 лет назад +5

    These videos are incredibly helpful. You have a real talent for clear and engaging instruction. Much appreciated!

  • @JoeyLeung8
    @JoeyLeung8 9 лет назад

    Thank you so much for filling this void. You are tackling issues that many in the learnjavascript community see as a the first large jump in difficulty!

    • @funfunfunction
      @funfunfunction  9 лет назад

      Joey Leung Thank you so much for saying that. It's exactly what I was going for. I'm a firm believer that functional programming isn't harder to understand than object-oriented programming - it's just badly explained.

  • @FalconFetus8
    @FalconFetus8 6 лет назад

    I love the pace you speak at! It gives me plenty of time to wrap my head around it!

  • @JuiceMa5ter
    @JuiceMa5ter 5 лет назад

    Fantastic series. As a on-native English speaker I like the pace, enunciation and the sense of humour.

  • @ΘεοδόσιοςΔέρβος
    @ΘεοδόσιοςΔέρβος 7 лет назад +2

    That's what I was looking for, Advanced JS!!!You are an amazing teacher and you have a sense of humor at the same time.

  • @warisulimam3440
    @warisulimam3440 Год назад

    The "HELLO!" at the beginning nearly burst my eardrums. Brilliant content, by the way!

  • @PankajSharma-vl6pg
    @PankajSharma-vl6pg 3 года назад +2

    such a great teacher with entertainer

  • @daveshomechannel1440
    @daveshomechannel1440 6 лет назад

    Basically, you are keeping me from tearing chapter 5 of Eloquent JS out of the book and lighting it on fire. Thanks so much. These vids rock.

  • @natereiners
    @natereiners 8 лет назад

    Hear loud sipping sound; instantly parched. Also -- Thank you Thank you Thank you!! Can't say it enough. I find reading about this stuff very dry and confusing. You've helped me immensely and your passion is contagious.

  • @shivangchaturvedi237
    @shivangchaturvedi237 3 года назад

    I am watching this series from the future. I wish I had discovered your series 6 years back.

  • @marcdroz3369
    @marcdroz3369 6 лет назад

    been subbed(on my main acc) for so long, i was stuck on an excersice (googling for 20mins) then randomly searched here, saw your video and got the answer in less than 2 mins, thanks!

  • @averial9831
    @averial9831 8 лет назад

    great stuff. just used filter for the first time yesterday, and stumbled on your videos today. very well organized, and easy to understand. Keep it up. Functional programming === the best way to program.

  • @awamvictor2784
    @awamvictor2784 2 года назад

    Hi MPJ, I am actually watching this video from the future, and it is so helpful.

  • @justinnguyen5924
    @justinnguyen5924 9 лет назад +1

    This is awesome! Your personality complements with your teaching perfectly. It is educating and entertaining, much better than reading more javascript books. There aren't much material out there that really go into detail with higher order functioning other than eloquent javascript but the examples there are difficult to parse.

  • @llaneelyort5599
    @llaneelyort5599 8 лет назад

    ONLY on part 2 BUT Ive learned more in the last 8:56 seconds than a semester at university. thank you.

  • @FabienHuetz
    @FabienHuetz 9 лет назад +4

    You can add the fact that log may be used as an higher order function to compose all the things :
    console.log( animals.map( a => a.name ) );
    **classy**
    because this function is an expression !

  • @martinaweidenbaum3066
    @martinaweidenbaum3066 7 лет назад

    Thank you for making these videos!!!!!! You truly have a gift for communicating potentially tricky concepts with such clarity. I will continue to use your videos throughout my coding journey (which began in December 2016). Thanks again!

  • @andyfangaf
    @andyfangaf 8 лет назад

    This has got to be the most well put series on functional programming :)

  • @jasonholtkamp6483
    @jasonholtkamp6483 8 лет назад +7

    Best programming videos on youtube!

  • @carleinarsson851
    @carleinarsson851 8 лет назад

    Började precis plugga programmering och dessa videor är guld värda ! Tack och fortsätt !

  • @vampbat
    @vampbat 8 месяцев назад

    Thank you for your videos! I have been struggling to learn very basic concepts. Your videos have helped in ways that looking at online Documentation alone just has not. Thank you!!

  • @ramsimon8045
    @ramsimon8045 9 лет назад

    mpjme hey man! I absolutely love the way you lay out the material and THEN break it down into small peaces that are easy to be understood by mere mortals like us, I've watched well over 20+ high order function videos and none of them made sense anywhere close to the way you make sense, I'm really glad I found you, finally somebody speaks the language I do :) I hope you gonna continue with making these amazing videos, thanks whole a lot for doing this, peace

    • @funfunfunction
      @funfunfunction  9 лет назад +3

      This makes me VERY happy to hear, this is exactly what I'm going for. As for "speaking language the way you do", I think it's just good language. To be perfectly honest, this is all just public speaking 101. Anyone who has studied basic rhetoric and writing will do what I do - the problem is that it is very rare for techies to be interested in humanistic subjects too, so that is why it is hard to find material that is presented by someone with proper training in presentation.
      I think a lot of people unnecessarily feel stupid because programmers lack solid communication skills. As a field, we really need to shift our focus a little bit from writing code and thinking a bit more about communicating about it. Getting more women into the field would be a good start.

  • @hilkokriel5659
    @hilkokriel5659 5 лет назад

    Just discovered this channel in 2019...still freaking brilliant!!!

  • @Mikerrrs21
    @Mikerrrs21 7 лет назад

    Just have to say that I have been learning so much from your videos and they are always entertaining so I don't loose concentration. Love your work! Please keep them coming. 😁

  • @Mannaio7
    @Mannaio7 9 лет назад +1

    before to understand better arrow function ( and the same for coffeescript i would say) a very good javascript understanding is necessary i think, congratulations for your channel, top quality stuff, keep up the good work

  • @mojtabamalaekeh6972
    @mojtabamalaekeh6972 5 лет назад

    You're an awesome teacher. You describe things as simple as possible for me and probably for many others :) Thanks.

  • @jeevanprakash4815
    @jeevanprakash4815 7 лет назад

    I appreciate the hard work (editing) done to publish these quality videos. Awesome!!!!!!!!!!!

  • @rawadkaram8011
    @rawadkaram8011 8 лет назад +3

    You are insanely fun to watch haha! You make me WANT to learn functional programming.

  • @producdevity
    @producdevity 7 лет назад

    Your love for clean code is so awesome!!!

  • @yashh7449
    @yashh7449 Месяц назад +1

    hey there ,,,, watching this from the future ,,, it was recommended by fullstackopen course by University of Helsinki
    amazing video btw,,, it made understanding higher order functions so much easier
    thank you ❤❤❤

  • @mindbodysouldeveloper9688
    @mindbodysouldeveloper9688 8 лет назад

    The end code is so beautiful that it made me cry of joy /sniff
    Good stuff. Thank you all your videos!

  • @mushahidhussain1516
    @mushahidhussain1516 3 года назад +1

    Yes, I'm watching from the future and you are right.

  • @pvu2391
    @pvu2391 7 лет назад

    I cracked up at "If you watch this video from the future, you don't have to do this ..." XD. Great video, instant like !

  • @ThibaultMaekelbergh
    @ThibaultMaekelbergh 7 лет назад

    First video to ever speak the wise words which could save newcomers time: 'if you're watching from the future you don't have to do this' :D

  • @sashaikevich
    @sashaikevich 8 лет назад +2

    As Mitch Hedberg would tell you, every video you make, will be watched in the future.

  • @haili903
    @haili903 6 лет назад

    I have been watching this episode for many times. It is so amusing.

  • @williammasferrer9067
    @williammasferrer9067 3 года назад

    Awsome video. You and Dev ed have the most authentic way of doing videos.

  • @arturhakobyan3022
    @arturhakobyan3022 3 года назад +1

    7:40 your sentence makes me feel COOL😂 cuz I am watching from the future😂

  • @geocine
    @geocine 7 лет назад

    I am watching this from the future. thank you for these wonderful tutorials

  • @oyindrilabhattacharjee6483
    @oyindrilabhattacharjee6483 8 лет назад

    I am in love with the way he makes "function --> fun fun function" :D

  • @keff_cb
    @keff_cb 8 лет назад

    Great way of explaining and teaching, ive learned more in a week of waching you that two months of random tutorials, suscribed man., and keep the great work.

    • @funfunfunction
      @funfunfunction  8 лет назад

      Thanks you so much for your kind words. Glad to be of service!!!

  • @slfajf
    @slfajf 8 лет назад

    Loving the videos! Thanks for giving so freely to the community!

  • @videoman5396
    @videoman5396 4 года назад

    you explain things so well while actually keeping my attention, thank you!

  • @pablodespoisse-chagot1031
    @pablodespoisse-chagot1031 2 года назад

    Just perfect ! Thanks for you've done to the community, hope you like a lot your new job !

  • @escaparatevisual
    @escaparatevisual 9 лет назад

    I did not have a clear idea of map/reduce use cases, but thanks to you now I get it!

    • @escaparatevisual
      @escaparatevisual 9 лет назад

      +Luis Serrano BTW you're also a bit crazy. Luv u hahaha

  • @kristofbe1
    @kristofbe1 9 лет назад

    Great videos! You explain things very clearly and your enthusiasm is enticing. Keep them coming.

  • @georgepickett7210
    @georgepickett7210 8 лет назад

    Thanks so much for making these videos! Now that I'm past the absolute basics of learning JS, it's really hard to find informative/helpful content on the more intermediate/advanced concepts. I'd love to see a video series on React.js using ES6!

  • @minimalist34
    @minimalist34 8 лет назад +6

    the arrow function is so beautiful it makes me cry :'(

  • @don-jp2rs
    @don-jp2rs 9 лет назад +4

    I really like your style in explaining the point, please let me know if you are organizing any meetups at Stockholm as I would be interested to attend.
    Thanks !

  • @alibadiee2255
    @alibadiee2255 5 лет назад

    TnQ MPJ , I like your way of teaching , when i see your videos , I laugh and learn. Tnx because that

  • @Purveyorofawesome
    @Purveyorofawesome 7 лет назад

    Who knew I would feel like I learned some JavaScript today. Thanks!

  • @koozdra
    @koozdra 9 лет назад +8

    Really great set of videos!
    You can make it a little more concise:
    var names = animals.map(x => x.name)
    you had:
    var names = animals.map((x) => x.name)
    Parenthesis are optional when there is only one parameter.

  • @PENDANTturnips
    @PENDANTturnips 8 лет назад +1

    Thank you for turning the volume up

  • @lbarcelocarrera
    @lbarcelocarrera 6 лет назад

    Many thanks for your videos! I'm finding them really easy to follow! Keep it up!

  • @jjobkr
    @jjobkr 8 лет назад

    You really bring fun to your video lessons. Thanks for your work.

  • @rockhounding
    @rockhounding 6 лет назад

    You rule, and your videos are a treat. Thanks for all the hard work you are putting into these!

  • @manonfire3
    @manonfire3 8 лет назад +1

    You're pretty much my favorite person. I love your videos so much man!

  • @jorgeriveramx
    @jorgeriveramx 8 лет назад +13

    when you receive only 1 argument in the arrow function, you can also leave parenthesis out. var names = animals.map(x => x.name) and make it even shorter.
    I don't think that renaming a variable to a single letter is a good idea, it makes the program cryptic, I prefer to keep it more readable even if that means longer code.
    I also think that shorter code doesn't mean less bugs, I think that simpler code means less bugs, yes simpler code is shorter because it has less stuff (less parts is simpler) so this means that a correlation between shorter and less bugs exist but correlation is not the same as causality. This difference matters because when you try to shorten code just for the sake of shortening you risk creating cryptic code that can result in more bugs instead of less.

    • @funfunfunction
      @funfunfunction  8 лет назад +1

      +jorge rivera please note that were not simply talking shorter code here. I probably should have left out the arrow functions from these examples because it confuses my message. The code is not short because we are writing with a more terse syntax, it's that map genuinely saves us from writing logic.
      I talk about this in part 1 of this series I think, this video is part 2.

    • @jorgeriveramx
      @jorgeriveramx 8 лет назад +1

      funfunfunction
      I have watched the whole series, very good material I'm now a subscriber to your channel.
      In the previous comment I just wanted to make it clear for everyone watching the video that shorter is not what make it better, simpler is. Because I think that the way that it was stated may lead to the wrong assumption.
      I know how difficult making this kind of tutorials is because I have tried to make some videos myself but I didn't uploaded any because I'm not satisfied with the end result and you are doing such a great job in this channel and I just wanted to say thanks

  • @browsermage
    @browsermage 8 лет назад

    Personen som räknar sina tecken fångar mitt intresse :)

  • @PalermoDeschamps
    @PalermoDeschamps 8 лет назад +3

    Can you do a series on computer science fundamentals and javascript please. These are great vids on basic functional programming in JS, but I think it would be cool if you talked about CS concepts too.

  • @unev
    @unev 7 лет назад

    Thank you for sharing your knowledge. Great work!
    It would be stupendous if you make a bunch of episodes on frontend architecture using vanilla JS. Maybe you could also share the 20% of patterns set you use on day to day basis.

  • @swagnikdutta7263
    @swagnikdutta7263 7 лет назад

    This is the first time a tutorial genuinely made me laugh :D (@ 1:08)
    The videos are really fun to watch and full of life. Needless to say, concepts are explained very well too.

  • @robmajuri1037
    @robmajuri1037 6 лет назад

    You make this topic understandable even for a beginner like me!

  • @shesanosan
    @shesanosan 7 лет назад

    Nice Tutorial, you just made me to understand map() in the simplest way. Keep the good job

  • @muratasarslan2359
    @muratasarslan2359 9 лет назад +1

    I really like it and found very helpful. Please continue your efforts on Javascript. Thank you :)

  • @jhj39
    @jhj39 6 лет назад

    Great lecture!!! I really like how how you make it fun by making jokes and putting jazz in the background!

  • @ArgeKumadan
    @ArgeKumadan 8 лет назад +1

    in c# we have this since 2008 :) and great library which is called Linq(Language Integrated Query). I've found some JS library which is called LinqJS. that was amazing :)
    Arrow functions are called Lambda Expressions in C#. great tutorial thanx :)

    • @funfunfunction
      @funfunfunction  8 лет назад +1

      +Ali Göl yeah, C# added lambdas and map after JavaScript popularized them. Even Java has them now.

  • @cesarin3134
    @cesarin3134 7 лет назад

    Your videos are always interesting , I help me to understand many things about JavaScript and some weird behaviors , thanks a lot !

  • @Occel0t575
    @Occel0t575 7 лет назад

    You make people love javascript again ! Thanks :-D

  • @ignorance1Zbliss
    @ignorance1Zbliss 8 лет назад +2

    I love your series (just subscribed)!!! Thanks for making it fun :)

    • @funfunfunction
      @funfunfunction  8 лет назад +2

      +seinna gausman thanks!!

    • @everydayhustle6641
      @everydayhustle6641 8 лет назад +1

      Same. I'm actually surprised at how fun he's made simple explanations lol. Great vids, definitely

  • @haibaidzokwomandre1468
    @haibaidzokwomandre1468 4 месяца назад +1

    Watching from the future and video recommended by fullstackopen course by University of Helsinki

  • @charliejulietdavies8715
    @charliejulietdavies8715 7 лет назад

    the fully shortened arrow function really is beautiful.

  • @kkevincerdaa
    @kkevincerdaa 7 лет назад

    You are the best. You make learning so easy and fun. Thank you.

  • @alan.mroczek
    @alan.mroczek 7 лет назад +38

    I'm watching from the future, I don't have to use harmony ✌

    • @Sage16226
      @Sage16226 5 лет назад +2

      Fuuuuuttuurrree

    • @Ray-lh3oc
      @Ray-lh3oc 4 года назад +3

      @@Sage16226 FUUUUTURE

    • @puppycatuaena4270
      @puppycatuaena4270 4 года назад +1

      Fuuuuutureeeeee

    • @Ray-lh3oc
      @Ray-lh3oc 4 года назад +2

      @@puppycatuaena4270 FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUTERRRRRRRRRRRRRRRRREEEEEEEEEEEEEEEEEEEEEEE

    • @entropy3387
      @entropy3387 4 года назад +2

      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

  • @MrCiDevant
    @MrCiDevant 8 лет назад

    I am smiling the whole time watching your Videos. :))
    Thanks!

  • @DANJUMA9
    @DANJUMA9 8 лет назад +3

    Lol dude I LOVE you videos. Hilarious yet very informative. Subscribed!

  • @emilylagreou8723
    @emilylagreou8723 4 года назад +1

    Watching video from the future here !

  • @taygrande_tv
    @taygrande_tv 6 лет назад

    Your videos are great! I’ve learned a ton watching this and the previous episode. Thank you!!!

  • @theoiorga
    @theoiorga 6 лет назад

    Also, in arrow functions, if you have a single argument, you can remove the brackets around it. So you basically would have:
    const names = animals.map(x => x.name);

  • @edvandossantossousa455
    @edvandossantossousa455 4 года назад

    I´m in future "now" and I say: Wonderful job!. Thanks for sharing with us.

  • @sandoxs
    @sandoxs 5 лет назад

    Awesome videos!!! Just to mention one thing- you dont need parenthesis if you have only one parameter on arrow functions:
    var names = animals.map(x => x.name);

    • @funfunfunction
      @funfunfunction  5 лет назад

      haha, this video is from 2015 when I got plenty of complaints for using ES6 features like arrow functions because they were distracting. :D

  • @adityadubey5204
    @adityadubey5204 2 года назад +2

    Hi Watching this from future that --harmony-arrow-functions is not needed now thanks :)

  • @JamesDHarrington
    @JamesDHarrington 7 лет назад

    So much louder than part 1 lol XD Great videos as always! thanks so much

  • @csmania8263
    @csmania8263 3 года назад

    You can lose another two characters if you get rid of the parenthesis around 'x'. Good video by the way, love the one you teach currying, really blew my mind!

  • @bpraghu
    @bpraghu 8 лет назад

    Love your videos. I like the way how you explain concepts. Subscribed.