Higher Order Functions in JavaScript Explained Simply

Поділитися
Вставка
  • Опубліковано 11 лют 2025
  • Higher Order Functions & Callback Functions in JavaScript Explained Simply
    Linkedin: / teddy-smith-015ba61a3
    Website: www.teddysmith.io
    Github: github.com/ted...
    In JavaScript, a higher-order function is a function that takes one or more functions as arguments, or returns a function as output. These functions are a powerful feature of the language that allow you to write concise and expressive code.
    The best way to learn higher order functions (and likely the most “real-world”) is to look at “map()” and “filter()”. Both take functions as arguments where the function is applied to each element in an array.
    Map
    For example, consider the map function, which is used to apply a function to each element of an array and return a new array containing the results.
    The map function is a higher-order function because it takes a function as its argument, in this case the function to apply to each element of the array.

КОМЕНТАРІ • 28

  • @_onlyFran_
    @_onlyFran_ Рік тому +4

    +1 subscriber, There is no way to make a simpler explanation. Thank you so much.

  • @leandrorodriguez4444
    @leandrorodriguez4444 5 місяців тому

    I wish more people would explain code like you. Very good explanations and analogies. It's super easy to understand. I feel like you covered all possible confusions that people might have, that others don't even think of.

  • @julieyeaeun
    @julieyeaeun Рік тому +1

    I'm mad I didn't find your channel sooner. God tier instructor... thank you!!!

  • @Isaac-ro1jl
    @Isaac-ro1jl 2 місяці тому

    glad i found this channel!!

  • @alexnorby4987
    @alexnorby4987 9 місяців тому

    good lord, all I had needed was the explanation of func vs func(). It all makes sense now, thanks!

  • @mohabdulai7238
    @mohabdulai7238 Рік тому +1

    Wow 👏.. You've just simplified everything to my understanding. I'm your new subscriber.

  • @LizyAd
    @LizyAd 7 місяців тому

    You just gained a subscriber!! Thanks for teaching!

  • @eyoutube1
    @eyoutube1 Рік тому

    You, sir, now have a new subscriber. Great lesson, thank you!

  • @andriibibik39
    @andriibibik39 Рік тому

    That's exactly what I was looking for. Thanks!

  • @bryggmastaren
    @bryggmastaren 4 місяці тому

    love the pokemon reference. ill sub just cus of that. thank u, im still so confused over all this but you helped me a good bit along the way. well explained :)

  • @benbetterby6456
    @benbetterby6456 7 місяців тому

    Awesome!!! Thank you for making this video!!! :)

  • @caseyspaulding
    @caseyspaulding 2 роки тому +2

    Haha you make these video’s entertaining and educational 👍

    • @TeddySmithDev
      @TeddySmithDev  2 роки тому +3

      I notice when I say something crazy in the beginning the watch time goes up Lmao

    • @caseyspaulding
      @caseyspaulding 2 роки тому

      @@TeddySmithDev yea man I think you are onto something. Lol. Then I learn about roided out function passing to another function. Pretty cool haha

    • @TeddySmithDev
      @TeddySmithDev  2 роки тому

      lmao

  • @KiteDuo_CH
    @KiteDuo_CH Рік тому

    Awesome explanation! Thank you very much! The explanation with the return()() helped me a lot :D

  • @benejix
    @benejix Рік тому

    I love you for this bro.

  • @petrapaul2434
    @petrapaul2434 Рік тому

    Thank you so much ! ❤

  • @grahamtech
    @grahamtech Рік тому +1

    this actually made it more confusing

    • @grahamtech
      @grahamtech Рік тому +1

      nvm it actually makes sense now lol

    • @TeddySmithDev
      @TeddySmithDev  Рік тому +2

      I real life laughed lol

    • @vishnu2407
      @vishnu2407 6 місяців тому

      The life of a developer basically

  • @halalmeatshophk
    @halalmeatshophk Рік тому

    you just explained how it is done. but the important thing to know is why is it done this way? wrapping a function using another function, why? what r the benefits?
    it seems extra useless step.

    • @TeddySmithDev
      @TeddySmithDev  Рік тому

      so that you can execute code within code. also, the code can be modified and changed to whatever you want because it is being passed in. instead of hard coding it you just pass it in.

  • @DarrylHebbes
    @DarrylHebbes Рік тому

    Partial application

  • @ExpatTraderFX
    @ExpatTraderFX 2 роки тому

    G0D approves