javascript callback functions tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ย. 2024
  • fundamentals of Callback function in javascript explained
    - How to pass functions as parameters.
    - understanding callback hell
    - use of callback functions
    #JavaScript #Callback #function
    *My Udemy Courses
    www.udemy.com/...
    www.udemy.com/...
    Follow me for technology updates
    * / techsith
    * / techsith
    * / techsith1
    * / 13677140
    * / patelhemil
    Help me translate this video.
    * www.youtube.co...
    Note: use translate.goog... to translate this video to your language. Let me know once you do that so i can give you credit. Thank you in advance.

ความคิดเห็น • 673

  • @matthewkane5652
    @matthewkane5652 5 ปีที่แล้ว +108

    Thank you for explaining the "Why we use it". This often isn't explained and it definitely helps with understanding. Well done!

  • @traezeeofor
    @traezeeofor 4 ปีที่แล้ว +12

    Thanks so much for this.
    Currently learning Javascript on Codecademy and was hell of confused at the "HIGHER-ORDER FUNCTIONS
    , Functions as Parameters" section, but this clarified everything. I'm so grateful.
    I've previously favoured interactive learning of CodeCademy and FreeCodeCamp, but you've made me now look at video tutorials in a new light

  • @andrewferguson6901
    @andrewferguson6901 5 ปีที่แล้ว +1

    This is exactly what I needed to understand how callbacks work. I'm doing a node tutorial that has anonymous callbacks defined in-line and i had no idea why you would go out of your way to make a function more complicated by writing a function around it. This clears it up SO much

  • @rodwynnejones
    @rodwynnejones 7 ปีที่แล้ว +11

    Thank you, thank you, thank you.....I thought i'd never understand "callback" function, I've watched a few videos on this subject and could not grasp it and nearly gave up........but now......Thank you again.

  • @travisschnider
    @travisschnider 6 ปีที่แล้ว +8

    This is the best description of callback functions I've seen in all the internet. ...and believe me I've searched far and wide. Thanks for breaking this down for us!

  • @vitaquasus1120
    @vitaquasus1120 7 ปีที่แล้ว +6

    Great example of callback, your calc function and callback really shows the reason for using callbacks.

  • @DavidWoodMusic
    @DavidWoodMusic 5 ปีที่แล้ว +1

    This is the first video anyone and everyone should watch on this.
    So many videos go SO deep and complex without covering the basics that its almost impossible to learn.
    But you my friend.
    Are the best.

    • @Techsithtube
      @Techsithtube  5 ปีที่แล้ว

      Thanks Rick for the nice comment

  • @RedEyedJedi
    @RedEyedJedi 5 ปีที่แล้ว +4

    I love the way you correct the syntax errors but leave the word back spelled incorrectly. That's a true programmer haha

  • @adwaiths5438
    @adwaiths5438 8 ปีที่แล้ว +21

    Most valuable 15 mins of my day. Thanks! (y)

  • @Mikemillering1
    @Mikemillering1 5 ปีที่แล้ว +2

    I have been trying to understand callbacks all day on various blogs and other videos and this is the first time it is making a lot of sense. Great video and explanation.

    • @Techsithtube
      @Techsithtube  5 ปีที่แล้ว

      Glad you got it. Thanks for watching

  • @and6sdf
    @and6sdf 2 ปีที่แล้ว

    after 3 hrs tried to figure out callback function, I found this video and help me understand how and why to use callback. thank you Sir.

  • @gustavomonte6672
    @gustavomonte6672 3 ปีที่แล้ว

    The only one to come up with a simple and straightforward example of callback functions. Thanks!

  • @SridTech
    @SridTech 4 ปีที่แล้ว +1

    Making it straight to the point. No BS.
    Now I'm confident in using callbacks eventually forever. Thank you.

    • @Techsithtube
      @Techsithtube  4 ปีที่แล้ว +1

      Thanks for watching Sridhar. I am glad that you will remember this forever, my job is done here. :)

  • @gl3862
    @gl3862 5 ปีที่แล้ว +47

    “just in case somebody pass a garbage”
    😂😂😂

    • @Techsithtube
      @Techsithtube  5 ปีที่แล้ว +4

      :)

    • @ahmedboutaraa8771
      @ahmedboutaraa8771 4 ปีที่แล้ว

      @@Techsithtube hhhh you are funny as hell you and i really enjoy your tutorials

    • @OMFGClare
      @OMFGClare 4 ปีที่แล้ว +5

      let garbage = function(trash) => {...};

    • @grantemerson5932
      @grantemerson5932 3 ปีที่แล้ว

      my favorite statement in the video

  • @dan-3268
    @dan-3268 5 ปีที่แล้ว +6

    Whenever I'm about to watch your video I know that by the end of it I'll understand the concept I couldn't wrap my head around.
    Thank you, kind sir!
    PS. Thanks for taking time to brush up on your accent. Normally it's quite difficult to understand everything when the speaker has a strong accent. Have a nice day, kind sir!

  • @tnduc91
    @tnduc91 7 ปีที่แล้ว +1

    Excellent point man (y)
    The way you introduced callback satisfies the Open&Close principle in SOLID.
    The O stands for: Open for extensions but close for modification. We are able to extend function "calc" as much as we want, but should not modify it ;)
    Love your tutorial!!!

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      Excellent point. Thanks for sharing! :)

  • @genjimccorkle5518
    @genjimccorkle5518 4 ปีที่แล้ว

    You actually teach these concepts very well. My bootcamp does a horrible job of explaining these functional programming concepts.

  • @hughclarke8504
    @hughclarke8504 4 ปีที่แล้ว

    I am studying a course in JavaScript and they explained (call back function) but I was so confused after I was done, they made it seem so hard. Thank you for explaining, great JOB.

  • @kennybills
    @kennybills 8 ปีที่แล้ว +4

    Best explanation I have found yet. You made callbacks very simple to understand. Thanks!

  • @gautammalik6146
    @gautammalik6146 6 ปีที่แล้ว +1

    Sorting example was just awesome...I am almost following your channel for more than a year and get the job also as a node is developer...all credit goes to you 😄....now planning to learn data structures and algorithms... could you please help where I can start using JavaScript... because most of the examples are in Java or other languages...I want to do it practically.... thanks again I am earning bread for my family because of your channel :)

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      I have started a new channel for data structures and interview related questions. It's interviewnest feel free to check it out

  • @LinnovelDev
    @LinnovelDev 7 หลายเดือนก่อน

    Thank you so much! I learn a lot. I see that you are not uploading videos, you must return and teach the next generation. You are a great teacher!

  • @rahulkumar-ot4ie
    @rahulkumar-ot4ie 6 ปีที่แล้ว +1

    I liked the point when u say y we r doing this. Many channels wont explain it. But the most imp point is y we r using a particular technique

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Thanks for watching Rahul. I am glad that you learn something! :)

  • @alekss.9991
    @alekss.9991 5 ปีที่แล้ว +1

    Amazing, I had 3 hours of this on my class yesterday, couldn't understand a thing! Cristal clear after 15 mins of your tutorial, thanks a lot!

  • @singsarav
    @singsarav 8 ปีที่แล้ว

    You are teaching many valueable javascript lessons in a easy way. Your free service is highly appreciated. We were really dummies before we look at your lessons.

    • @Techsithtube
      @Techsithtube  8 ปีที่แล้ว

      Thank you! Do let me know if you want certain topics covered.

    • @singsarav
      @singsarav 8 ปีที่แล้ว

      Recently interviewers have asked stunning questions which I didn't expect.
      1) How do u handle cache
      2) How do u handle offline when DB disconnected, still my application should survive with offline data downloaded previously, once DB is connected then it should handshake and continue as normal
      3) Handling Threads in Javascript when server need more time to process and send results to the client
      4) minification of js. Is it so important? Usually ignore that
      5) Versioning management in javascript. Is it so important? Usually ignore that
      6) Unit testing in javasciprt
      Other than these broadly lot of client side frameworks need to learn. (AngularJS, Backbone JS, Ember JS, Node JS, Require JS, Polymer, Handlebar, etc).

    • @Techsithtube
      @Techsithtube  8 ปีที่แล้ว +1

      All the really good topics.
      1) Handling cache
      You can do something like this in your html
      scr="myJs.js?121212"
      basically add a new number every time your deploy. There is a good solution using gulp . I will create a tutorial on that.
      2) How to handle offline ( there are multiple solution to this. If you are using a JS platform you can use their technique. for exmaple if you are using ember.js you can use ember data. I will have to create a tutorial on that.
      3) for handling the Threads in Javascript ( I have a tutorial on that th-cam.com/video/pMK-jcOAYI8/w-d-xo.html)
      4) minification.js it is important depending on your application and number of users. Tell me the size of your application and number of people involved. there is a gulp solution which is very easy to implement)
      5) Which versioning management are you referring to ?
      6) Unit testing is very important, however this again depends on the size of your application . If you are using a javascript platform, versioning comes with it so you can use it there . I will make a tutorial on that.
      I am going to start Angular2 and EmberJs tutorials really soon. Angular2 is the latest platform and a very important one. EmberJs would cover handlebar as well. I am also thinking about polymer. If you are learning a new platform i would suggest that dont learn AngularJs1( this was the first version and going away soon) and Backbone.

    • @Techsithtube
      @Techsithtube  8 ปีที่แล้ว

      3) Unfortunately JavaScript is single threaded. even using WebWorker is not multi threaded. This might change in the future.
      4) Use npm and bower to solve the version issue. if client modifys the code and mixes dependancy. this would become their issue. You should be clear on how to install and if they are going to mix , they should let you know in advanceed.
      6) Backbone is still used but not many people choosing it for new apps. I think if you have a simple project you can still use it .

  • @daukimngansgsu
    @daukimngansgsu 4 ปีที่แล้ว

    Have spent days trying to understand the "callback", finally got it after watching your video. A huge, huge thank!

  • @keith6293
    @keith6293 5 ปีที่แล้ว

    For a short video, it was actually quite full of informations.
    Clear and concise so i appreciated it.
    I watched it in 1.5 speed but it looked like it was at normal speed, so it's good, you obviously take the time to explain clearly and pronounce every word correctly. Thanks a lot for that because sometimes people talk really too fast or don't bother pronouncing anything the right way and you end up losing a lot of informations!
    Thumb up (y)

    • @Techsithtube
      @Techsithtube  5 ปีที่แล้ว +1

      Glad it helped, I think its very important to understand callbacks in JavaScript, no one should move forward without properly understanding it. Thanks for watching .

  • @jrb65
    @jrb65 3 ปีที่แล้ว +1

    one of the best explanations for callback function

  • @mahajanravish
    @mahajanravish 6 ปีที่แล้ว +11

    after roaming months on youtube finally i found this 😊

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว +4

      I am glad you found it. Thanks for watching Ravish!

  • @AhmedVlogs1
    @AhmedVlogs1 6 ปีที่แล้ว

    Finally understood callback...after watching this video...thanks a Lot

  • @abhilash8555
    @abhilash8555 5 ปีที่แล้ว

    I'm a java developer with 5 years of experience in the technology and peripheral frameworks. I've recently started to mug into JS as our new requirements are all transitioning into it. As you can understand it's a new territory and the all these functions acting weirdly is mind numbing for a java guy. Thanks so much, your video helped me so much in understanding the core need for callbacks. Please make one on promises.

  • @zaidhaan
    @zaidhaan 7 ปีที่แล้ว +16

    Hi there! your videos are very easy to understand and are all briefly explained, thankyou for making these videos! also I think it would be useful for you to create videos talking about the classes, constructors, and extending them in es6 because they seem to be also something which is going to be helpful at times. :)

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว +8

      I am going to create a tutorial on classes next.

  • @yaboiickydick9456
    @yaboiickydick9456 7 ปีที่แล้ว +4

    8:59 how I feel sometimes, when I'm misunderstanding something in javascript, but this tutorial is great!

  • @jasongifford6851
    @jasongifford6851 6 ปีที่แล้ว

    You deserve a quieter place to live and thank you for the great content!

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Jason , you noticed :) Since that video , i do have a semi private bit more quieter place. :)

  • @rajabmuhamedrajab5128
    @rajabmuhamedrajab5128 4 ปีที่แล้ว +2

    Thank You , I ' am Understand callback function you are great

    • @Techsithtube
      @Techsithtube  4 ปีที่แล้ว

      Glad to hear that Ragab.

  • @CyberAbyss007
    @CyberAbyss007 7 ปีที่แล้ว +3

    Thank you! Good video. So callback is just a placeholder when I want to be able to pass a function in to another function, then it acts as the function itself once we inject it in to the other function where we can substitute callback "in our minds" with the name of the function we passed in the code logic. Yay! I think I got it now!

  • @erykczajkowski8226
    @erykczajkowski8226 5 ปีที่แล้ว +2

    I completely don't understand the hype for anonymous functions. You save writing one word really (name of the function!) at the cost of making the code MUCH harder to read and understand (nesting into nesting into nesting into....).

    • @Techsithtube
      @Techsithtube  5 ปีที่แล้ว

      it depends on the application . if its a onetime thing you can use anon function.

  • @arkhamian7586
    @arkhamian7586 4 ปีที่แล้ว

    You explained "Why" we use them rather than just "How" (which is less significant). Thank you.

  • @prasannanaik1023
    @prasannanaik1023 3 ปีที่แล้ว

    Most important he explained when exactly it is useful! Thanks

  • @ZGGuesswho
    @ZGGuesswho 7 ปีที่แล้ว +3

    Extremely good teaching. Argument caught, no error thrown.

  • @bishawjitkumardey2075
    @bishawjitkumardey2075 7 ปีที่แล้ว +2

    been scratching my head trying to understand callbacks in java. thank you very much for such a nice relief!

  • @amagdziarek1689
    @amagdziarek1689 7 ปีที่แล้ว +13

    Hey, thanks for this, it's a very easy to understand explanation, I appreciate it!

  • @maximos118
    @maximos118 5 ปีที่แล้ว

    Out of all of the videos on youtube, it's this one that gave me the eureka moment. I was very familiar with using callback functions in this way: someVar.addEventListener('click', () => {callback}) but creating a callback as a parameter for another named function really threw me off. Reall well explained. Thanks dude!

  • @nanchussss
    @nanchussss 2 ปีที่แล้ว

    The best explanation i have found so far. Really good thankyou so much!!!

  • @Slarti
    @Slarti 7 ปีที่แล้ว

    Thanks for the explanation - very clearly explained.
    I have question though - if you have a pattern like this:
    if (a === 1){
    return "Hello world 1";
    }
    else {
    return "Hello world 2";
    }
    Why not just code:
    if (a === 1){
    return "Hello world 1";}
    return "Hello world 2";
    As the else is unnecessary due to the first return causing flow to break out if it evaluates as true so an else in not needed?

  • @Nexus2UAll
    @Nexus2UAll 6 ปีที่แล้ว

    Previous comment didn't show up!
    Here goes nothing:
    Thanks pal! Made that simple to understand for a beginner like me (unlike so many geeky explanations).

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      I am glad it helped. Thanks for watching!

  • @harshini.bhesettyharshu3595
    @harshini.bhesettyharshu3595 4 ปีที่แล้ว +1

    my doubt might sound silly but well please try to explain. In sort method what that return 1 and return -1 mean??

  • @kevinadrian2640
    @kevinadrian2640 3 ปีที่แล้ว

    Thanks, its really the best explanation for callback functions - i watched a few videos and didnt get it till yet

  • @GraceandWisdom
    @GraceandWisdom 4 ปีที่แล้ว

    Thanks techsith! This definitely cleared up what it means to callback a function. Sir, You are AWESOME!

    • @Techsithtube
      @Techsithtube  4 ปีที่แล้ว

      You are most welcome! When started learning JavaScript, callback function was so confusing. Once you know callbacks lot of thinks openup

  • @StriverHamza
    @StriverHamza 5 ปีที่แล้ว

    Thanks for such an excellent video on callbacks. I've read a lot and been through a few videos trying to grasp callbacks and it hasn't clicked in my head until I came across your video.

  • @krishnareddyrenabothu1409
    @krishnareddyrenabothu1409 7 ปีที่แล้ว +1

    My confusion got cleared, more detailed, Thanks very Much

  • @MosesJeromeCLucas
    @MosesJeromeCLucas 6 ปีที่แล้ว +1

    your second example just made me realize callbacks are could be more. Keep it up

  • @prathameshmali3888
    @prathameshmali3888 4 ปีที่แล้ว

    I've been struggling for many hours finally understand callbacks. Thanks sir.

  • @harisbjelic9026
    @harisbjelic9026 7 ปีที่แล้ว +14

    You're a hero! Thanks for this great tutorial!

  • @vaitalaziz100
    @vaitalaziz100 8 ปีที่แล้ว +21

    Really u have explained very simply & smart way that anyone can catch it clearly and easily. Great job. Carry on and good luck for the next tutorials ;)

    • @williamjamesrapp7356
      @williamjamesrapp7356 4 ปีที่แล้ว

      NOT ANYONE , I am the type person that does not understand ABSTRACT information and then can be expected to apply it to a real world situation. I have no idea what he was talking about and I have watch SO MANY JS videos I cant even count them. I understand HTML, CSS, PHP, SQL but I have yet to see a JS video where they apply it in a real world scenario all of this abstract language means nothing to me. ALTHOUGH, I am happy for you that it all makes sense. I just wish I could find a video that would TEACH JS in actual usage and not in abstract techno information.

  • @bluelion978
    @bluelion978 2 ปีที่แล้ว

    Great explanation!! I understood more through your explanations. But I think the doWhatever callback at 9:06 returned undefined due to double console.log.... I could be wrong...

  • @muhammadwaqas-zt7xl
    @muhammadwaqas-zt7xl 7 ปีที่แล้ว +1

    i am learning JS just from your tutorial and and you explanation is good God bless you Thank you

  • @displayblock6696
    @displayblock6696 7 ปีที่แล้ว

    thank you so much from Egypt your explanation method is amazing it's really fine thank you so much i really love you. but i get a little bit confused because i feel that your playlists are not arranged if you rearrange it this will be a great thing.

  • @PrudhviRajRaavi
    @PrudhviRajRaavi 3 ปีที่แล้ว +1

    How to find what parameters needs to be passed for callback in case of a third party libraries function
    For example in socket.io
    io.on('connect',(socket)=>{
    })
    How do we know socket is the parameter here

  • @MarcoFeregrino
    @MarcoFeregrino 7 ปีที่แล้ว +9

    The best video of callbacks I've ever seen

  • @devendradeo5833
    @devendradeo5833 3 ปีที่แล้ว +1

    just loved the explanation, thank you sir.

    • @Techsithtube
      @Techsithtube  3 ปีที่แล้ว

      Devendra, thanks for the comment! Keep on learning!

  • @pramodkharade5373
    @pramodkharade5373 4 ปีที่แล้ว

    it is good explanation. Sir I am new to javascript field so I would request to create video with example of callback vs promise vs observable. if you would do then it would be great help to who are new to javascript. Thanks

  • @lindseyr1845
    @lindseyr1845 7 ปีที่แล้ว +1

    This was a simple and clear explanation! I finally understand callback functions. Thanks for making this!!

  • @MsCrusifix
    @MsCrusifix 5 ปีที่แล้ว

    i have been following your tutorials from some time and really wanted say thank you for ths wonderful job. not all got the capability to make others understand in a simple and precise way. again thank you

  • @kartikisahu4938
    @kartikisahu4938 5 ปีที่แล้ว +2

    You are really awesome. I just love the way you explain complex concepts.

  • @shivGGG
    @shivGGG 4 ปีที่แล้ว

    Please add more examples, it makes more clearer on concepts, love your videos. Guruji :)

  • @GautamKumar-uideveloper
    @GautamKumar-uideveloper 6 ปีที่แล้ว

    Awesome video full clarification about callback.

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Thanks for watching Gautam!

  • @johnmacward
    @johnmacward 3 ปีที่แล้ว

    What I'm trying to understand, is the word "callback" unique and protected in JS? IS it what enables this behaviour to call other variable functions as parameters. Or could I just as easily write bob() ?

  • @utkarshsahu4357
    @utkarshsahu4357 4 ปีที่แล้ว

    best explaination of callback function

  • @jamesmoreau6832
    @jamesmoreau6832 6 ปีที่แล้ว

    Thanks for sharing. Callbacks have been driving me up the wall.

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      I am glad that it cleared up the concept of callbacks. :)

  • @dialecticalmonist3405
    @dialecticalmonist3405 2 ปีที่แล้ว

    So, it seems to be a way of creating abstractions?
    Whereas in other languages, one would create an "abstract function" or "interface".
    Does that sound right, or no?

  • @advertronicssystems8377
    @advertronicssystems8377 3 ปีที่แล้ว

    Best explanation of callbacks ever

  • @roksimilijan
    @roksimilijan 7 ปีที่แล้ว +3

    Thanks man! This tutorial made me understand callback functions. Great way to explain essence of this JavaScript part :)

  • @kiwi-Centaur
    @kiwi-Centaur 2 ปีที่แล้ว

    I really like the way to teach stuff, its comprehensive and clear, thanks for taking time to make these videos.

  • @midasman714
    @midasman714 6 ปีที่แล้ว

    Very clear in explanation. This is the first video I've watched from you but plan on watching a lot more!

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Welcome Eric, let me know if you want me cover specific topic. Thanks for watching! :)

  • @JoberneNgambeneb
    @JoberneNgambeneb 7 ปีที่แล้ว

    You're the best! I spent two nights trying to grasp this callback concept and ended up understanding little. You made my progress real. thick books aren't always good :(

  • @nineironshore
    @nineironshore 6 ปีที่แล้ว

    I was hoping this would be about callbacks that are handled by the browser. Why are these called callbacks? I don't think they are called callbacks in other languages unless the function is call is deferred?

  • @a-ezzat5677
    @a-ezzat5677 6 ปีที่แล้ว

    in the second example how did we assume the values of each val1 and val2 ? from where function understood to make up for both with 0 and 1 index

  • @majia
    @majia 7 ปีที่แล้ว +1

    Thank you so much, you gave such a clear and easy to follow explanation of callback functions.

  • @santhoshdevaraj8697
    @santhoshdevaraj8697 7 ปีที่แล้ว +36

    Door knock @ 2:07...Seems somebody at home is not happy ;)

    • @gabovanlugo
      @gabovanlugo 7 ปีที่แล้ว

      Twitch Style, lol :P

    • @dipteshmukherjee346
      @dipteshmukherjee346 7 ปีที่แล้ว

      yes i too heard that

    • @jyotilondhe259
      @jyotilondhe259 7 ปีที่แล้ว +41

      she didnt understod callbacks

    • @jasperzanjani
      @jasperzanjani 5 ปีที่แล้ว +14

      his wife heard "callback" and she said "who the fuck are you calling he, your side bitch?"

    • @levatruskavec2199
      @levatruskavec2199 5 ปีที่แล้ว

      ааааа ! Спасибо пасоны , угарнул ! )))
      автору респект, хорошее ввод в колбэк функции.

  • @mustaphag
    @mustaphag 8 ปีที่แล้ว +1

    Good videos, Keep up the good job

  • @Loficomposer
    @Loficomposer 5 ปีที่แล้ว

    this examples make more sense for me cuz usually an=m not that gd with callbacks bt now am more comfortable with it thank you man

  • @julianstorm7722
    @julianstorm7722 4 ปีที่แล้ว

    Thanks heaps. Straight to the point, clear and easy to follow. Been struggling with the instructions given on codeacademy on this very topic. Thumbs up mate.

    • @Techsithtube
      @Techsithtube  4 ปีที่แล้ว

      THanks for watching Julian!

  • @mayanks633
    @mayanks633 4 ปีที่แล้ว

    dear,
    great tutorial on callback. but can you help me to explain how sort method get invoked automatically when we did not even call it manually?

  • @MissBoom135
    @MissBoom135 2 ปีที่แล้ว

    Best explanation I've come across! Thank you

  • @finkygsd2720
    @finkygsd2720 6 ปีที่แล้ว +1

    finally someone explained callbacks! thanks!

  • @mohankumar850
    @mohankumar850 4 ปีที่แล้ว

    Hi Sir First of all i need to thank you for such a nice video which is available free of cost in online, I am a fresher started learning Java script, Can you suggest me some good books and useful links from where i can expertise my JS skills

  • @ramazankhan5930
    @ramazankhan5930 4 ปีที่แล้ว

    Dude. Never knew you can do that. Awesome. Keep it up. If no one likes it people like me would like it.👍🏼

    • @Techsithtube
      @Techsithtube  4 ปีที่แล้ว

      Ramazan, I really appreciate the like , thank you!

  • @rfbu
    @rfbu 7 ปีที่แล้ว +2

    just want to say it has been well delivered and well prepared.

  • @mohanpradeepkumar.ppathuri9956
    @mohanpradeepkumar.ppathuri9956 6 ปีที่แล้ว

    Techsith tutorial javascript it is helping me a lot Thank.

  • @abuhurayraratul5530
    @abuhurayraratul5530 2 ปีที่แล้ว

    Great example of callback. Thanks man! This tutorial made me understand callback functions. Finally
    a well explained video about callback functions. It's hard to find nowadays.

  • @jaredcave1488
    @jaredcave1488 4 ปีที่แล้ว

    I've really struggled to understand callback functions and I'm still not 100% but this video really helped! Thanks

  • @AndresGuerrero
    @AndresGuerrero 3 ปีที่แล้ว

    Great video. Question: Why do you have to return the callback function?

  • @navdeepgupta7001
    @navdeepgupta7001 7 ปีที่แล้ว +1

    Ur videos are really very useful but give us some live example for every topic means while developing a project how can we use these topic,I would be more helpful.

  • @viery3654
    @viery3654 8 ปีที่แล้ว +1

    Thank you! Finally a well explained video about callback functions. It's hard to find nowadays.

  • @MoneyMaking33
    @MoneyMaking33 6 ปีที่แล้ว

    good explanation of callbacks. thnks

  • @sanfordhoffman2392
    @sanfordhoffman2392 7 ปีที่แล้ว +1

    I liked your video. You do a great job describing callback functions. It's crystal clear to me now what it is. In C# they are called delegates.

  • @prernasingh7783
    @prernasingh7783 5 ปีที่แล้ว

    your video has made call backs so simple for me!!! Thanks in tonnes ..

    • @Techsithtube
      @Techsithtube  5 ปีที่แล้ว

      I am glad that you learnt Prerna. Thanks for watching! :)

  • @aniltechcamp4086
    @aniltechcamp4086 6 ปีที่แล้ว

    thank you for explaining in Easy way

  • @bulghurbulghur3698
    @bulghurbulghur3698 7 ปีที่แล้ว +1

    Nice, simple and to the point. Thanks!

  • @sujeetagrahari2292
    @sujeetagrahari2292 5 ปีที่แล้ว

    Callback is a function which is passed to another FUNCTION and it will be executed at SOME POINT when the FUNCTION 's execution has finished.
    Why not just after the FUNCTION'S execution, but after some point? Because it depends on the execution stack, if it's empty ,callback will be executed immediately after FUNCTION's execution and there is no other task in message queue.
    This is what makes callback non-blocking.
    Take it this way, I have some code that needs to be executed . But before this code I have some other code which is time taking maybe API calls, some other processing that can take time. Okay, what is the problem? Problem is JavaScript is single threaded and it runs code in synchronous way.
    We don't execute this piece of code immediately but we pass it to WEB API. What WEB API does it process the task in the background, making the API CALL, and attaches the callback as an event handler that will be executed when the process is finished.
    What will happen then?
    After the process finishes, it push the callback to the message queue. Where this callback waits to be executed once the execution stack is empty.
    Who determines that ,EVENT LOOP. Once the execution stack is empty it will process the message queue.