Higher Order Functions Javascript | forEach, filter, map, and reduce functions

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ย. 2024

ความคิดเห็น • 41

  • @oncoding4520
    @oncoding4520 ปีที่แล้ว +14

    As I told you... For each video that I will watch I will comment and like the video. Its the most basic support that we can give to you. What I like about your videos is that they are somehow "long' and I think that programming videos should be not short. We are learning concepts here, and concepts are just theory you need to dive deep to understand in order to form the mental pattern. So keep up the good work and thank you for what you are doing for us.

  • @80Vikram
    @80Vikram 2 ปีที่แล้ว +2

    This is best explanation of HOF I found on YT till date, thanks a ton for your efforts. God bless you.

  •  3 ปีที่แล้ว +2

    We liked how you showed things and tie them together , Hope you can continue making these kind of videos

  • @stillnai
    @stillnai 2 ปีที่แล้ว +1

    bro this was really well explained, thank you! also appreciate the clean and modern js

  • @kostiantynkarzhanov9216
    @kostiantynkarzhanov9216 ปีที่แล้ว

    Thank you so much!💛

  • @silva_santos
    @silva_santos 3 ปีที่แล้ว +1

    Thanks for the explanations, I really needed this 🙏🏻

  • @CondeAlberto
    @CondeAlberto 2 ปีที่แล้ว

    Very clear, we keep going forward. Thank you again Dave.

  • @Pareshbpatel
    @Pareshbpatel 2 ปีที่แล้ว +2

    A great tutorial on Higher Order Functions. Beautifully explained. Thank you, Dave
    {2022-03-09}

  • @yatin1370
    @yatin1370 ปีที่แล้ว

    This was such a top notch tutorial! Thanks for providing MDN links too, I used it for reduce( ) and accumulator concept is clear!

  • @abdirahmanabdullahi1966
    @abdirahmanabdullahi1966 2 ปีที่แล้ว

    Thanks grey for this beautiful video. short and precise

  • @nabilc0d3z
    @nabilc0d3z ปีที่แล้ว

    As usual! free and high quality video. Thank you so much Dave 🙏🏽
    I wonder if I can have or play with the files you are demonstrating with 😅

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  ปีที่แล้ว +1

      It's good to recreate these files / examples on your own :)

    • @nabilc0d3z
      @nabilc0d3z ปีที่แล้ว

      @@DaveGrayTeachesCode Thank you, I actually did just that 😅

  • @user-ls4wj4oc4v
    @user-ls4wj4oc4v ปีที่แล้ว

    Hi Dave, I've a doubt here, so this lecture starts as
    A higher order function does at least ONE of the following:
    1) takes one or more functions as an argument (parameter)
    2) returns a function as its result.
    so but the functions written in this lecture are taking post obj as argument and again doing some computation and returning again an arg which is obj. so please help me understand this part. thank you for the lectures though

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  ปีที่แล้ว +1

      All of these functions take an anonymous function as their argument. Post is the parameter of the anonymous function.

    • @OlaRsk
      @OlaRsk 5 หลายเดือนก่อน

      If I understand, that was why the reduce function could take two argument (sum, post)

  • @viditgoel2909
    @viditgoel2909 11 หลายเดือนก่อน

    thanks for this tutorial

  • @SC-bv6kx
    @SC-bv6kx 3 ปีที่แล้ว +1

    Hi Dave, great video as always! I understand the map method doesn't mutate the original array. After I saw the example you provide (return id * 10), I was thinking what if I want to update id to id * 10, and return a new array. How can I do that? Create a new array and push the new ids in? Thank you for your time!

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  3 ปีที่แล้ว +3

      From what you are describing, I think your solution with creating a new array and pushing in the new id values would work. As you noted, map would not mutate the original values like you are wanting to.

  • @siddiqahmed3274
    @siddiqahmed3274 2 ปีที่แล้ว +1

    Const people = [ { name: 'siddiq', age: 20} , { name: 'anas', age: 19}]
    Const arr = people.reduce((acc, curr) => acc.push(curr.age), [])
    It is not working. What i want is to creare an array with only ages...??

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 ปีที่แล้ว +1

      After you define your people array, try this: people.map(person => person.age);

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 ปีที่แล้ว +1

      After you define your people array, try this: people.map(person => person.age);

    • @siddiqahmed3274
      @siddiqahmed3274 2 ปีที่แล้ว

      @@DaveGrayTeachesCode okay thank you sir. But could you please explain why that thing is giving an error. It is constantly saying acc.push is not a function ( or something like that)?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 ปีที่แล้ว +1

      @@siddiqahmed3274 You don't want to use array.push () inside of map. map() already returns a new array.

  • @ajith7682
    @ajith7682 ปีที่แล้ว

    im facing error in importing the json data saying "Cannot use import statement outside a module"..pls help me

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  ปีที่แล้ว

      You will need to indicate the script is a module. From lesson 24: th-cam.com/video/Q3SBogjUfMk/w-d-xo.html

  • @abdulrahmanagboolaosho3582
    @abdulrahmanagboolaosho3582 ปีที่แล้ว

    could you please do a javascript full project like you did with html and css

    • @abdulrahmanagboolaosho3582
      @abdulrahmanagboolaosho3582 ปีที่แล้ว

      or even a html, css and javascript full project
      you could even use the little taco shop

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  ปีที่แล้ว +1

      I have a playlist on my channel with Vanilla JavaScript projects: th-cam.com/play/PL0Zuz27SZ-6PA3nkkEAr91n4bK-NunwPU.html

  • @prasanthdeventhiran4159
    @prasanthdeventhiran4159 2 ปีที่แล้ว

    dave i need one help dave can you please provide your email i wukk send error screenshot for you please help me dave

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 ปีที่แล้ว

      Hello Prasanth, you may have already asked in my Discord, but if not, here is a link: discord.gg/neKghyefqh I'm getting ready to check questions there now.