• Friday , 22 September 2017

Map – Part 2 of Functional Programming in JavaScript

Code Canyon



In this video series, we learn how to do functional programming in JavaScript. In this second one, I show you how and when to use the higher-order function map, and why it is the best thing ever.
Resources:

Code from the video
https://gist.github.com/mpj/c5ae804e576042b3287d

How to install and use io.js (for the arrow functions example)

ES6 in io.js



Original source

3d Ocean

Related Posts

36 Comments

  1. Taylor Lindores-Reeves
    August 30, 2017 at 07:50

    I had part 1 on max volume with headphones in because the audio is quite low. Then I played this video and you're like "HELLO!" and nearly jumped out of my seat in starbucks. LOL

  2. James D. Harrington
    August 30, 2017 at 07:50

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

  3. TTibus
    August 30, 2017 at 07:50

    Hi, I'm watching this from the future and don't need to do that harmony thing 🙂

  4. Theo Dervos
    August 30, 2017 at 07:50

    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.

  5. Zohaib Tesneem
    August 30, 2017 at 07:50

    What if I wanted to get all animals that are dogs?

  6. Eamonn Byrne
    August 30, 2017 at 07:50

    cool video 🙂

  7. Frank Pigeon
    August 30, 2017 at 07:50

    great videos, why am I just learning about you. Keep up the great work. *Subscribed*

  8. Francis Ben Lleve
    August 30, 2017 at 07:50

    i like how he not use semi colon to end statements. I believe the JS engine do it for him

  9. CHANDRABHAN SINGH
    August 30, 2017 at 07:50

    I am sorry if someone already asked or I totally miss understood the topic, but I believe the map function loops inside itself, so what the buzz about "map", it is just an extension. But the final code that executed would always be the same or more in this case.

  10. Thibault Maekelbergh
    August 30, 2017 at 07:50

    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' 😀

  11. MadeyBytes
    August 30, 2017 at 07:50

    So good!

  12. MasterPuppets206
    August 30, 2017 at 07:50

    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' }
    ]

  13. Antonio Dorado
    August 30, 2017 at 07:50

    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.

  14. Hema M
    August 30, 2017 at 07:50

    Awesome the way you explained buddy

  15. Confiteror
    August 30, 2017 at 07:50

    I am ginger, I have no soul… But I see beuty in this 😀

  16. Олег Лозинський
    August 30, 2017 at 07:50

    Some nice comment to MPJ,

  17. Kevin Cerda
    August 30, 2017 at 07:50

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

  18. Alex Hinds
    August 30, 2017 at 07:50

    'This is because arrays of animals are very common in enterprise programming'. Damn that got me good.

  19. Arjun Pillai
    August 30, 2017 at 07:50

    If you were my professor, I might of actually not dropped out of college.

  20. Yavor
    August 30, 2017 at 07:50

    It's better to use join() when printing arrays.

  21. Yavor
    August 30, 2017 at 07:50

    It appears that I'm watching this video from the future. 🙂

  22. Sesan Osanyinbi
    August 30, 2017 at 07:50

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

  23. Niranjan Sharma
    August 30, 2017 at 07:50

    Functional programming done on Arrays is neat, How to do the same when you are dealing with a big object with nested objects ??

  24. Калоян Велков
    August 30, 2017 at 07:50

    Cool 😀

  25. Daniele Irsuti
    August 30, 2017 at 07:50

    YOU WIN ALL

  26. codetap
    August 30, 2017 at 07:50

    I really really like your stuff. I always imagined myself doing something very similar to how you do it however fear struck me and I forgot to let myself be crazy like I like to be. Thanks for filling in some gaps that I have.
    On the other hand, I'd like to return you a favor and let you know that:
    CTRL + J (on a selection of multiple lines) will convert them in one line separated by space, more like:
    lines.join(' ');
    Thanks again! You're really cool.

  27. Priyanka Malviya
    August 30, 2017 at 07:50

    Best teacher!!!!!!

  28. meauxx
    August 30, 2017 at 07:50

    Press 9 for the best part of the video.

  29. Ivaylo Iliev
    August 30, 2017 at 07:50

    yoo, this guy is so fun to watch and I am really learning things, and the best thing is that he reminds me that there are other weird and energized people out there as well 😀

  30. Martina Weidenbaum
    August 30, 2017 at 07:50

    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!

  31. Amin
    August 30, 2017 at 07:50

    after very long time now i began to understand u, so i also started liking ur jokes 🙂

  32. Mark Kessler
    August 30, 2017 at 07:50

    I am watching from the future and you were right (7:40)

  33. Yannis
    August 30, 2017 at 07:50

    https://youtu.be/bCqtb-Z5YGQ?t=1m7s

    "WHAT?! What does it mean?"

    Good laugh!

  34. Shuaibird Hwang
    August 30, 2017 at 07:50

    The code above could be more interesting by using the ES6 destructuring.
    var names = animals.map(({ name: n }) => n)

  35. Engineer Passion
    August 30, 2017 at 07:50

    8:31
    also it could be shorter if you remove the parenthesis from (x)
    it will be like this
    “`
    var names = animals.map(x => x.name)
    “`

  36. A. Lionel C. Kouadjani
    August 30, 2017 at 07:50

    I don't understand why I understand. You are amazing, hilarious. wow.

Leave A Comment

You must be logged in to post a comment.