Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; COUNT_CLASS has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/functions.php on line 1713

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; sidebar_generator has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/plugins/multiple_sidebars.php on line 29

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_video_widgets has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/video.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_soundcloud has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/soundcloud.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_counter_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/social-counter.php on line 9

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_news_in_pic has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/new-in-pic.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Flickr_Widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/flickr.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_fb_likebox has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/fb.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_google_follow has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/google-follow.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_popular has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/popular-posts.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_recent_posts has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/recent-posts.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_cate_posts has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/category-posts.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tabs_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/tabs.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_youtube_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/youtube-subscribe.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_social_links has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/social-links.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_comments_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/comments.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_author_bio has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/bio-author.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_login has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/login.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_search_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/search.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Ad_120_600_Widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/ads120.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Ad_125_125_Widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/ads125.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Ad_250_250_Widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/ads250.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Ad_300_300_Widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/ads300.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_tweets_load has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/twittes.php on line 10

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; feedburner_widget has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/newsletter.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_related has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/related.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_slider has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/slider.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bd_top_rate has a deprecated constructor in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/themes/renad/includes/widgets/top-review.php on line 6
Mastering JavaScript Callbacks | D4mations.com
  • Thursday , 25 April 2019

Mastering JavaScript Callbacks

Code Canyon



Learn how to manage asynchronous callbacks and avoid callback hell.

Getting started with Node.js / io.js: https://www.youtube.com/watch?v=Ads1A7pn2LI

Code examples used in this video: https://github.com/shama/letswritecode/tree/master/mastering-callbacks

Original source

3d Ocean

Related Posts

30 Comments

  1. Nadir Amini
    April 13, 2019 at 16:49

    Very good explanation but the video quality is very poor

  2. Kyle Yasumiishi
    April 13, 2019 at 16:49

    This tutorial is what made callbacks finally click for me. Thanks a ton!

  3. ghastly
    April 13, 2019 at 16:49

    At 13:00, would there be any advantage to changing the function 'loadBears' to something like this:
    function loadBears(bear){…}
    And then onLoad calling loadBears with bears.shift() as a parameter?

  4. Dagmawi Gashaw
    April 13, 2019 at 16:49

    It could not get any more clear. Thank you so much Kyle!

  5. My Phone
    April 13, 2019 at 16:49

    Please zoom in or increase font size next time

  6. Abhishek Udataneni
    April 13, 2019 at 16:49

    I am sorry I am a newbie.. Just curious what did you mean by "any sync call is going to Block the thread"?? Great vid though !!

  7. Mozif Beigh
    April 13, 2019 at 16:49

    fs.readfile(filepath,function(err, bears){
    if(err) return done(err)
    }

    If there is err in above code, will done cb be executed with err parameter and we get the error message OR

    it will just return the done cb with err something like:

    var returnvalue= getBears('bears.txt',function(err,bears)
    {
    console.log(bears);
    }
    and after we can execute:
    returnvalue();

  8. Samer Sabri
    April 13, 2019 at 16:49

    Great video! Thanks 🙂

  9. Anto N
    April 13, 2019 at 16:49

    I really liked your video

  10. Pravasith Kumar
    April 13, 2019 at 16:49

    At first I thought this is a really complicated example because i am new to functional programming, but then after watching this video over and over many times , and after doing different operations through different .txt files, i really understood callback functions. Love this video! For people who are completely new to functional programming, I would suggest watching a few beginner videos about .filter function, .map function, .reduce function, beginner videos about callback functions and working out a few basic examples on them (really important) and then watching this video to gain perfection on callbacks. This video is aptly titled 'Mastering JavaScript Callbacks'

  11. spik330
    April 13, 2019 at 16:49

    Please explain how it works more that why we use it. As someone from Java, I'm completely lost.
    function(err, bears) { *stuff*} <– who, what, when, where, why?function(err, dict) { *stuff*}what are these values? can I use them outside the nested pile of code?

  12. Aditya Hegde
    April 13, 2019 at 16:49

    Kyle, that was an amazing video. I had a question though. Is the stuff written inside these functions synchronous ? Consider the compareBears function. Does the bear line run after the dict line, is that part synchronous ?

  13. Cixtian Rush
    April 13, 2019 at 16:49

    Love the tut, but had to watch in a few times, and pause in places to follow.

    You're obviously a guru, I think maybe you're moving a little to quickly for this to be easy to follow.

    For the rest of you who don't agree… you're guru's as well.

    LOL Loved the tut… can't wait to see more.

  14. Tomasz Cysewski
    April 13, 2019 at 16:49

    thx nice code

  15. maks burkov
    April 13, 2019 at 16:49

    Man your explanation for beginners about asynchronous callbacks is terrible ..

  16. Casey M
    April 13, 2019 at 16:49

    bears cares dares snares pares

  17. pwnageseason
    April 13, 2019 at 16:49

    i cant believe you didn't call your 'compareBears'-function 'comBear' :p

  18. Paul Ventura
    April 13, 2019 at 16:49

    This was the tut I was searching for. Thank you dude n.n

  19. Emm Huitrado
    April 13, 2019 at 16:49

    Dude, you're focusing too much on doing logic for your bears and nothing in the synchronous and asynchronous calls. Please try to think about the people who really would like to learn and master those calls. Thanks

  20. Sudeep Makwana
    April 13, 2019 at 16:49

    thanks alot ..

  21. Ddd Rrr
    April 13, 2019 at 16:49

    where can i watch the video that explains the image() function being called? is there a way to show an image to the screen without having to include an image() function?

  22. mathIsART
    April 13, 2019 at 16:49

    How can you call node js code from the browser?

  23. m ch
    April 13, 2019 at 16:49

    thanks.

  24. ron dunphy
    April 13, 2019 at 16:49

    This was helpful, Kyle, thank you.

  25. Tom Yang
    April 13, 2019 at 16:49

    what sofware did u use ?

  26. Pranay Singh
    April 13, 2019 at 16:49

    This was a really helpful tutorial, thanks a lot man !

  27. Phú Nguyễn
    April 13, 2019 at 16:49

    I notice you don't use semicolon in your javascript. Is this a good practice? Do you have any comments or idea behind your habit? Or did you read any article regarding this?
    By the way, nice tutorial!

  28. Matt Viverette
    April 13, 2019 at 16:49

    I really enjoyed this video and these are great examples of callbacks, but it would have been nice to have a better explanation of callbacks themselves. Also, it would have been nice to see a few refreshes of the browser to demonstrate the bears loading in different orders. Or perhaps they never will because the file sizes don't change? Not sure…

  29. Tito T.
    April 13, 2019 at 16:49

    Are going to have another video to explain this video?

  30. FichDichInDemArsch
    April 13, 2019 at 16:49

    Horrendous.

Leave A Comment

You must be logged in to post a comment.