Higher Order Functions in JavaScript Explained Simply

Тәжірибелік нұсқаулар және стиль

Higher Order Functions & Callback Functions in JavaScript Explained Simply
Linkedin: / teddy-smith-015ba61a3
Website: www.teddysmith.io
Github: github.com/teddysmithdev
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.

Пікірлер: 23

  • @LizyAd
    @LizyAd20 күн бұрын

    You just gained a subscriber!! Thanks for teaching!

  • @_onlyFran_
    @_onlyFran_6 ай бұрын

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

  • @TeddySmithDev

    @TeddySmithDev

    6 ай бұрын

    No prob. Sweet name lol

  • @julieyeaeun
    @julieyeaeun Жыл бұрын

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

  • @benbetterby6456
    @benbetterby6456Ай бұрын

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

  • @alexnorby4987
    @alexnorby49872 ай бұрын

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

  • @andriibibik39
    @andriibibik3911 ай бұрын

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

  • @mohabdulai7238
    @mohabdulai72389 ай бұрын

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

  • @eyoutube1
    @eyoutube1 Жыл бұрын

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

  • @petrapaul2434
    @petrapaul2434 Жыл бұрын

    Thank you so much ! ❤

  • @benejix
    @benejix Жыл бұрын

    I love you for this bro.

  • @KiteDuo_CH
    @KiteDuo_CH8 ай бұрын

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

  • @caseyspaulding
    @caseyspaulding Жыл бұрын

    Haha you make these video’s entertaining and educational 👍

  • @TeddySmithDev

    @TeddySmithDev

    Жыл бұрын

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

  • @caseyspaulding

    @caseyspaulding

    Жыл бұрын

    @@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

    Жыл бұрын

    lmao

  • @DarrylHebbes
    @DarrylHebbes10 ай бұрын

    Partial application

  • @grahamtech
    @grahamtech6 ай бұрын

    this actually made it more confusing

  • @grahamtech

    @grahamtech

    6 ай бұрын

    nvm it actually makes sense now lol

  • @TeddySmithDev

    @TeddySmithDev

    6 ай бұрын

    I real life laughed lol

  • @ExpatTraderFX
    @ExpatTraderFX Жыл бұрын

    G0D approves

  • @halalmeatshophk
    @halalmeatshophk7 ай бұрын

    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

    7 ай бұрын

    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.

Келесі