Learn JavaScript CALLBACKS in 7 minutes! 🤙

Поделиться
HTML-код
  • Опубликовано: 13 окт 2024

Комментарии • 73

  • @BroCodez
    @BroCodez  Год назад +25

    // 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!");
    }

    • @Blitz61wasd
      @Blitz61wasd 11 месяцев назад

      @BroCodez Django course please

    • @Blitz61wasd
      @Blitz61wasd 11 месяцев назад

      Bro i subscribed and liked can you make django course

    • @-_SleepAndEat_-
      @-_SleepAndEat_- 5 месяцев назад

      Bro can you do Kali Linux ?

  • @1992daven
    @1992daven 9 месяцев назад +48

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

    • @thatlastborn
      @thatlastborn 7 месяцев назад

      Right!!!

    • @jimmyhaotran123
      @jimmyhaotran123 4 месяца назад

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

  • @thatlastborn
    @thatlastborn 7 месяцев назад +23

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

  • @isaiahaguilera7973
    @isaiahaguilera7973 10 месяцев назад +19

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

  • @masterwitcher317
    @masterwitcher317 6 месяцев назад +5

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

  • @a1m4thah3d
    @a1m4thah3d 18 дней назад

    Anytime I'm learning something new and struggling, I watch a BroCode video and walk away totally getting it. I LOVE how everything is clear and concise and not a lot of needless rambling.

  • @vallunacoder.wecodetogether
    @vallunacoder.wecodetogether 9 месяцев назад +10

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

  • @mohitanand5646
    @mohitanand5646 3 месяца назад +1

    Thank you for those example codes. Those really help with understanding the concept in-and-out of the box.

  • @saichaithrik7134
    @saichaithrik7134 6 месяцев назад +1

    one of the greatest explanation i have ever seen

  • @3lirez
    @3lirez 5 месяцев назад +1

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

  • @r3dwulf3
    @r3dwulf3 5 месяцев назад

    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.

  • @kunalpal6647
    @kunalpal6647 10 месяцев назад +3

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

  • @usman_acts
    @usman_acts 8 месяцев назад +1

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

  • @ColeHartman1
    @ColeHartman1 4 месяца назад

    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.

  • @liamrichardson62
    @liamrichardson62 2 месяца назад

    THANK YOU SO MUCH😭. I really needed this⭐

  • @ФёдорСёмочкин
    @ФёдорСёмочкин 5 месяцев назад

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

  • @vedantrawat4064
    @vedantrawat4064 5 месяцев назад

    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... ❤

  • @sridhararivazhagan1323
    @sridhararivazhagan1323 2 месяца назад

    Thanks for this wonderful explanations I understand this in easy way thanks bro🎉

  • @sarabadr1376
    @sarabadr1376 8 месяцев назад

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

  • @CHANDRASHEKARRAHCS
    @CHANDRASHEKARRAHCS 5 месяцев назад

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

  • @rameenana
    @rameenana 5 месяцев назад

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

  • @Eldorbek-Yokubjonov
    @Eldorbek-Yokubjonov 6 месяцев назад

    the most simple and human understandable explanation thanks bro code

  • @anitamurphy2323
    @anitamurphy2323 8 месяцев назад +1

    And i finally understand. Greetings from Ireland x

  • @SpeaksYourWord
    @SpeaksYourWord 3 месяца назад

    The only freaking madlad that never disappoints. Only one.

  • @suwaddy1566
    @suwaddy1566 4 месяца назад

    Thanks for explaining callback function.

  • @johnwayne8059
    @johnwayne8059 5 месяцев назад

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

  • @elzosantos1253
    @elzosantos1253 7 месяцев назад +2

    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 5 месяцев назад

      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.

  • @juancruzsantillanmenendez4254
    @juancruzsantillanmenendez4254 11 месяцев назад +1

    You're the best, love from argentina!!

  • @zeelrana3369
    @zeelrana3369 Месяц назад

    Great explanation 👍

  • @ArthurWM9
    @ArthurWM9 11 месяцев назад +5

    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 10 месяцев назад +1

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

    • @Shubh_R_M
      @Shubh_R_M 10 месяцев назад +5

      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 : )

  • @jauerboo6526
    @jauerboo6526 8 месяцев назад +1

    good explanation!

  • @girishph.9970
    @girishph.9970 7 месяцев назад +1

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

  • @hasanatahmadzai9079
    @hasanatahmadzai9079 2 месяца назад

    Truely you're the best.

  • @piotrmazgaj
    @piotrmazgaj 2 месяца назад

    This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal.

  • @FindingFocus
    @FindingFocus 5 месяцев назад

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

  • @zine-el-abidine
    @zine-el-abidine 25 дней назад

    i got it, thank you your the best !

  • @Saquib-r4n
    @Saquib-r4n Месяц назад

    bro i am not understanding the callback since yesterday after ur explanation i m going to subscribe u ASAP!!

  • @jadad7296
    @jadad7296 11 месяцев назад +3

    cool

  • @iambrijeshtoo
    @iambrijeshtoo Месяц назад

    Thank you ❤

  • @johnnyenglish3867
    @johnnyenglish3867 11 месяцев назад +2

    legend

  • @divyaanshuagrawal3383
    @divyaanshuagrawal3383 2 месяца назад

    Thanks Bro!

  • @iamdhanush03
    @iamdhanush03 3 месяца назад

    Thank you

  • @rx808
    @rx808 11 месяцев назад +1

    legend!!

  • @mohammadalsallal7977
    @mohammadalsallal7977 6 месяцев назад

    this guy is insane

  • @ikki_nikoo
    @ikki_nikoo 2 месяца назад

    randomComment()
    // LOVE YOU BRO CODE THANKS YOU!

  • @7calculus
    @7calculus 3 месяца назад +1

    But if you use the setTimeout, then even with callback, bye is displayed first.....what's happening here?

  • @SadidIslam27
    @SadidIslam27 9 месяцев назад +1

    best

  • @Blitz61wasd
    @Blitz61wasd 11 месяцев назад +1

    Django course please

  • @abdoun8214
    @abdoun8214 7 месяцев назад +3

    still confused.

  • @guilhermemanoel116
    @guilhermemanoel116 3 месяца назад

    Goat!

  • @spencersedano
    @spencersedano 4 месяца назад

    Thank you bro code

  • @albertt755
    @albertt755 2 месяца назад

    This callback function seems complicated.

  • @tabaeimohamedamine9243
    @tabaeimohamedamine9243 День назад

  • @sportsknowledge92
    @sportsknowledge92 8 месяцев назад +1

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

  • @lorieldesamito3998
    @lorieldesamito3998 5 месяцев назад

    chad

  • @coding_stuff_uz
    @coding_stuff_uz 11 месяцев назад +4

    Bro Django please 🥲

    • @hungry_khid1007
      @hungry_khid1007 9 месяцев назад +1

      What is that , is it good?

    • @coding_stuff_uz
      @coding_stuff_uz 9 месяцев назад +1

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

  • @Theoublal
    @Theoublal 11 месяцев назад +1

    Bro react

  • @saliouseck7715
    @saliouseck7715 11 месяцев назад +1

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

  • @nahidhasan5607
    @nahidhasan5607 23 часа назад

    nice explanation!

  • @kathikr9360
    @kathikr9360 6 месяцев назад

    thank you

  • @shauryasingh63
    @shauryasingh63 5 месяцев назад

    Thanks Bro!!