Learn JavaScript CALLBACKS in 7 minutes! 🤙

00:00:00 introduction
00:00:50 example 1
00:04:00 example 2
// callback = a function that is passed as an argument
// to another function.
// used to handle asynchronous operations:
// 1. Reading a file
// 2. Network requests
// 3. Interacting with databases
// "Hey, when you're done, call this next."
hello(goodbye);
function hello(callback){
console.log("Hello!");
callback();
}
function goodbye(){
console.log("Goodbye!");
}

Пікірлер: 55

  • @BroCodez
    @BroCodez8 ай бұрын

    // callback = a function that is passed as an argument // to another function. // used to handle asynchronous operations: // 1. Reading a file // 2. Network requests // 3. Interacting with databases // "Hey, when you're done, call this next." hello(goodbye); function hello(callback){ console.log("Hello!"); callback(); } function goodbye(){ console.log("Goodbye!"); }

  • @user-mk2md9pu5m

    @user-mk2md9pu5m

    7 ай бұрын

    @BroCodez Django course please

  • @user-mk2md9pu5m

    @user-mk2md9pu5m

    7 ай бұрын

    Bro i subscribed and liked can you make django course

  • @-_SleepAndEat_-

    @-_SleepAndEat_-

    Ай бұрын

    Bro can you do Kali Linux ?

  • @1992daven
    @1992daven5 ай бұрын

    I love the way you explain. Those other youtubers had me lost.

  • @ewurafuaquansah_

    @ewurafuaquansah_

    3 ай бұрын

    Right!!!

  • @jimmyhaotran123

    @jimmyhaotran123

    6 күн бұрын

    exactly always got me lost when other youtubers keep on repeating something like, we put another function inside a function as a paramether and in the function block we call back to the function a callback function, that is why it is called a callback function. And then they continue on giving an example of either a function with another function as parameter, or array functions console logging the elements when iterating through the elements. Like why would console log be a callback function, they never explain, This video explains everything to me. Thanks!!!

  • @ewurafuaquansah_
    @ewurafuaquansah_3 ай бұрын

    Honestly callbacks really left me confused. This is by far the best explanation I’ve watched. Tysm ❤

  • @tayangantengahmalam2480

    @tayangantengahmalam2480

    3 ай бұрын

    True

  • @isaiahaguilera7973
    @isaiahaguilera79736 ай бұрын

    Bro, this was the easiest explanation I've ever seen. Thank you!

  • @3lirez
    @3lirezАй бұрын

    You explained this in the simplest way possible bro! Now I love the “Bro Code” Channel!

  • @masterwitcher317
    @masterwitcher3172 ай бұрын

    I love how you explain complex topics like this. You really helps me a lot.

  • @vallunacoder.wecodetogether
    @vallunacoder.wecodetogether5 ай бұрын

    Fell like I'm finally understanding js. Thanks BRO! Greetings from Colombia!

  • @kunalpal6647
    @kunalpal66476 ай бұрын

    Such a beautiful explanation, Bro...earned a sub!!

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

    Finally, I understood this. The concept was very confusing when others tried to explain it, and this video made it very simple to understand. Thank you for breaking it down.

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

    This was very helpful mate. Thanks! Appreciate your work.

  • @sarabadr1376
    @sarabadr13764 ай бұрын

    Thank you so much for making it so simple and understandable ❤

  • @user-cm8ds7rx6t
    @user-cm8ds7rx6tАй бұрын

    Your videos helped me understand JS although i have already watched a lot of videos on JS. Thanks Bro!

  • @saichaithrik7134
    @saichaithrik71342 ай бұрын

    one of the greatest explanation i have ever seen

  • @usman_acts
    @usman_acts4 ай бұрын

    @BroCodez : an impressive way to teach... A lot to learn in just 7 minutes Love from Lahore, Pakistan

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

    Thank You so much before this video I was not able to understand this concept , I am now able to understand better .... Pls provide more such informative videos like this... ❤

  • @suwaddy1566
    @suwaddy156627 күн бұрын

    Thanks for explaining callback function.

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

    liked the way u explained things so simple and clear keep posting 💌

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

    this was the video that finally helped this click with me. thank you!!!

  • @Eldorbek-Yokubjonov
    @Eldorbek-Yokubjonov2 ай бұрын

    the most simple and human understandable explanation thanks bro code

  • @anitamurphy2323
    @anitamurphy23235 ай бұрын

    And i finally understand. Greetings from Ireland x

  • @juancruzsantillanmenendez4254
    @juancruzsantillanmenendez42547 ай бұрын

    You're the best, love from argentina!!

  • @jauerboo6526
    @jauerboo65264 ай бұрын

    good explanation!

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

    What do you know about promises? Would be interesting to see something about it!

  • @ColeHartman1
    @ColeHartman116 күн бұрын

    One thing I believe could have been clarified is that callback() does not actually WAIT for the line of code above it to be done. If the line above is asynch, it will call callback() first.

  • @elzosantos1253
    @elzosantos12533 ай бұрын

    Hi, okay, I want to congratulate you for this incredible work, where you share your knowledge. I want to ask a question about how I render the results of the code in the console, so I know how to do it with HTML

  • @gloryanoliefo

    @gloryanoliefo

    Ай бұрын

    Add the relevant script tag in your HTML file and set the src to your javascript file, then go live from your vs code, then navigate to your console in your browser, you will see the changes rendered as you code.

  • @girishph.9970
    @girishph.99703 ай бұрын

    if you had explained it using the setTimeout function itself it would have been much easier to understand i think , but thankyou.

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

    Thanks Bro!!

  • @kathikr9360
    @kathikr93602 ай бұрын

    thank you

  • @rx808
    @rx8087 ай бұрын

    legend!!

  • @stingy.ae1
    @stingy.ae13 ай бұрын

    best like always

  • @johnnyenglish3867
    @johnnyenglish38677 ай бұрын

    legend

  • @mohammadalsallal7977
    @mohammadalsallal79772 ай бұрын

    this guy is insane

  • @jadad7296
    @jadad72967 ай бұрын

    cool

  • @ArthurWM9
    @ArthurWM97 ай бұрын

    So what's the difference between using a function as callback and just calling the function from inside the one which will take some time to finish? Wouldn't this accomplish the same thing? Thanks for the video!

  • @jesusjosemarthalaborin1014

    @jesusjosemarthalaborin1014

    6 ай бұрын

    I have the same question or is that even a callback function too?

  • @Shubh_R_M

    @Shubh_R_M

    6 ай бұрын

    Both works same in most of the cases but there are some points to be consider: 1 ) callback program flow is more controllable 2 ) asynchronous operation execution for e.g in video goodbye is executing later if we write normal hello function and call goodbye function in hello function and after calling goodbye function write another code then if goodbye function takes time to execute then other code after goodbye call will also has time delay . which is not happen in call back case . HOPE THIS HELP : )

  • @spencersedano
    @spencersedano26 күн бұрын

    Thank you bro code

  • @user-mk2md9pu5m
    @user-mk2md9pu5m7 ай бұрын

    Django course please

  • @SadidIslam27
    @SadidIslam275 ай бұрын

    best

  • @sportsknowledge92
    @sportsknowledge924 ай бұрын

    Hi bro code please make small small project using function object array

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

    chad

  • @abdoun8214
    @abdoun82143 ай бұрын

    still confused.

  • @coding_stuff_uz
    @coding_stuff_uz7 ай бұрын

    Bro Django please 🥲

  • @hungry_khid1007

    @hungry_khid1007

    5 ай бұрын

    What is that , is it good?

  • @coding_stuff_uz

    @coding_stuff_uz

    5 ай бұрын

    @@hungry_khid1007 Yes, of course. It looks like python

  • @Theoublal
    @Theoublal7 ай бұрын

    Bro react

  • @saliouseck7715
    @saliouseck77157 ай бұрын

    HI BROCODE THANKS FOR THE VIDEOS WHERE CAN WE CONTACT YOU ?