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
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
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.
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.
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!
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.
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 :)
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!!!
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!
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.
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.
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.
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 :(
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!
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)
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 .
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. :)
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!
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.
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).
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 ua-cam.com/video/pMK-jcOAYI8/v-deo.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.
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 .
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 ;)
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.
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
I have learnt so much on this video, I learnt to call back, grave accent instead of using + at all times and finally I learnt typeof , you're awesome keep up the good work
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).
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.
Very well explained. As a correction @0:08, they are not the same: higher-order functions are functions that take another function as an argument, that argument is the callback function.
Thanks mate! Very clear and simple to understand for a beginner like me. Had trouble finding a non-geeky explanation and you did the job nicely. All the best! :)
I am new to programming. If you were to add two more parameters to the add and mult functions--num1, num2, num3, num4--would you still be able to add just two numbers if you wanted to? Also, how would you write the parameters so you could add as many numbers as you wanted to? ex. 1+2+3+4+5+6+7+8 thank you
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?
I have a several unique functions capable of returning a number from a range randomly, where the type of range is what makes them unique. I have need to test the outputs of these functions to ensure certain eventualities are impossible. So I have written a function: function cbTestFor(callback, n){ /* while loop */ } It returns a string stating the number of iterations it took for `callback` to produce `n`. When the browser stalls I know `n` can not be produced by the function. It's crude I know, but it works. since sometimes the callback function I need to test takes parameters, I need a way to pass those through only when necessary, while otherwise not being required to pass them.
what i want is to arrange the videos from beginning to end. i mean if this is the first time i visit techsith youtube channel i wanna find like directory which shows to me the arrangement that i should follow from the beginning to the end :)
I have created a playlist for you where i have arranged videos in that order. Let me know what you think. ua-cam.com/play/PL7pEw9n3GkoUyw6qAFlX29Bfci0uRm-Gu.html
Thank you so much ❤️❤️❤️❤️. i will follow this arrangement but please complete it because i see in your channel a lot of videos but this playlist that you created ua-cam.com/play/PL7pEw9n3GkoUyw6qAFlX29Bfci0uRm-Gu.html just has 12 videos i want all of the JavaScript videos in your channel arranged from the beginning in one playlist to follow it. Thank you so much my teacher ❤️❤️❤️❤️❤️❤️❤️❤️
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.
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?
great video lesson. Thank you. just out of curiosity what were the -1 and 1 you were returning (for IF and else respectively) in the last segment of the lesson where you sorted the array based on an anonymous function?
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.
Thanks for making it simple. Although i am having doubt. Instead of passing callbavk function. We could have call add and multiply function inside calc function So how it is different to call callback function instead of calling function directly. Can you please explain it?
I think it's a way of creating abstractions. Javascript doesn't have "abstract" or "interface" functions. Passing a function as a parameter seems to be the way they handle it.
Thank you for explaining the "Why we use it". This often isn't explained and it definitely helps with understanding. Well done!
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
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
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.
Thanks Rick for the nice comment
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.
Glad you got it. Thanks for watching
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!
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.
Thanks for watching!
Making it straight to the point. No BS.
Now I'm confident in using callbacks eventually forever. Thank you.
Thanks for watching Sridhar. I am glad that you will remember this forever, my job is done here. :)
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!
I love the way you correct the syntax errors but leave the word back spelled incorrectly. That's a true programmer haha
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
Thanks for watching Rahul. I am glad that you learn something! :)
Great example of callback, your calc function and callback really shows the reason for using callbacks.
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 :)
I have started a new channel for data structures and interview related questions. It's interviewnest feel free to check it out
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!!!
Excellent point. Thanks for sharing! :)
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.
Have spent days trying to understand the "callback", finally got it after watching your video. A huge, huge thank!
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!
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.
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.
Best explanation I have found yet. You made callbacks very simple to understand. Thanks!
“just in case somebody pass a garbage”
😂😂😂
:)
@@Techsithtube hhhh you are funny as hell you and i really enjoy your tutorials
let garbage = function(trash) => {...};
my favorite statement in the video
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.
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 :(
Most valuable 15 mins of my day. Thanks! (y)
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!
No
Extremely good teaching. Argument caught, no error thrown.
Thanks :)
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)
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 .
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. :)
I am going to create a tutorial on classes next.
been scratching my head trying to understand callbacks in java. thank you very much for such a nice relief!
You actually teach these concepts very well. My bootcamp does a horrible job of explaining these functional programming concepts.
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!
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.
Thank you! Do let me know if you want certain topics covered.
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).
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 ua-cam.com/video/pMK-jcOAYI8/v-deo.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.
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 .
The only one to come up with a simple and straightforward example of callback functions. Thanks!
This was a simple and clear explanation! I finally understand callback functions. Thanks for making this!!
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 ;)
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.
i am learning JS just from your tutorial and and you explanation is good God bless you Thank you
your second example just made me realize callbacks are could be more. Keep it up
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
You deserve a quieter place to live and thank you for the great content!
Jason , you noticed :) Since that video , i do have a semi private bit more quieter place. :)
after roaming months on youtube finally i found this 😊
I am glad you found it. Thanks for watching Ravish!
Thanks for clearing that up. I've been using it but never had a clue what call back was. The term always confused me.
Thanks for watching!
I've been struggling for many hours finally understand callbacks. Thanks sir.
amazing , i used callback functions but i couldn't explain to others , from now i will explain callback functions
I have learnt so much on this video, I learnt to call back, grave accent instead of using + at all times and finally I learnt typeof , you're awesome keep up the good work
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).
I am glad it helped. Thanks for watching!
At the 7:57 mark, I don't get how callback is linked to the add and multiply functions. Can you please elaborate? Thanks in advance.
add and multiply functions are passed as an argument. to calculate function and inside the calculate function the argument is executed.
Thanks man! This tutorial made me understand callback functions. Great way to explain essence of this JavaScript part :)
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.
Thanks techsith! This definitely cleared up what it means to callback a function. Sir, You are AWESOME!
You are most welcome! When started learning JavaScript, callback function was so confusing. Once you know callbacks lot of thinks openup
Hey, thanks for this, it's a very easy to understand explanation, I appreciate it!
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
Thank you! Finally a well explained video about callback functions. It's hard to find nowadays.
The clearest description ever :) thank u!
Thanks for watching! :)
Very well explained. As a correction @0:08, they are not the same: higher-order functions are functions that take another function as an argument, that argument is the callback function.
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!
Door knock @ 2:07...Seems somebody at home is not happy ;)
Twitch Style, lol :P
yes i too heard that
she didnt understod callbacks
his wife heard "callback" and she said "who the fuck are you calling he, your side bitch?"
ааааа ! Спасибо пасоны , угарнул ! )))
автору респект, хорошее ввод в колбэк функции.
At 9:10, how the numbers are printed using '$' symbol? Is there any library included or simple Javascript on line 10 of code?
its called template string. it was introduced in javaScript few years so go as part of the new version ES6/ES2015 .
Thanks mate! Very clear and simple to understand for a beginner like me. Had trouble finding a non-geeky explanation and you did the job nicely.
All the best! :)
I am glad it helped. Thanks for watching ! :)
what you have done in this video is really wonderful and useful .
i hope all the best for you dude , keep going , all the best
Thanks for watching :) keep learning!
My confusion got cleared, more detailed, Thanks very Much
thanks for watching! :)
I am new to programming.
If you were to add two more parameters to the add and mult functions--num1, num2, num3, num4--would you still be able to add just two numbers if you wanted to?
Also, how would you write the parameters so you could add as many numbers as you wanted to? ex. 1+2+3+4+5+6+7+8
thank you
yes you can write a function that do that . here is an example codepen.io/codepatel/pen/wvGgwjz?editors=0012
@@Techsithtube thank you
just want to say it has been well delivered and well prepared.
You're a hero! Thanks for this great tutorial!
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.
You are really awesome. I just love the way you explain complex concepts.
one of the best explanations for callback function
Thanks for watching!
Thank You , I ' am Understand callback function you are great
Glad to hear that Ragab.
finally a great explanation with the WHY aspect!. Thank you Sir.!
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?
That also work. :)
I have a several unique functions capable of returning a number from a range randomly, where the type of range is what makes them unique. I have need to test the outputs of these functions to ensure certain eventualities are impossible. So I have written a function:
function cbTestFor(callback, n){ /* while loop */ }
It returns a string stating the number of iterations it took for `callback` to produce `n`. When the browser stalls I know `n` can not be produced by the function. It's crude I know, but it works.
since sometimes the callback function I need to test takes parameters, I need a way to pass those through only when necessary, while otherwise not being required to pass them.
what is this callback|10|7 ?
It's just an example. I was asking if anything LIKE it was possible. I've modified my original question to be less confusing
what i want is to arrange the videos from beginning to end. i mean if this is the first time i visit techsith youtube channel i wanna find like directory which shows to me the arrangement that i should follow from the beginning to the end :)
I have created a playlist for you where i have arranged videos in that order. Let me know what you think.
ua-cam.com/play/PL7pEw9n3GkoUyw6qAFlX29Bfci0uRm-Gu.html
Thank you so much ❤️❤️❤️❤️. i will follow this arrangement but please complete it because i see in your channel a lot of videos but this playlist that you created ua-cam.com/play/PL7pEw9n3GkoUyw6qAFlX29Bfci0uRm-Gu.html just has 12 videos i want all of the JavaScript videos in your channel arranged from the beginning in one playlist to follow it. Thank you so much my teacher ❤️❤️❤️❤️❤️❤️❤️❤️
taught me something in 2020 ❤️❤️
Same
Very clear in explanation. This is the first video I've watched from you but plan on watching a lot more!
Welcome Eric, let me know if you want me cover specific topic. Thanks for watching! :)
Very helpful, I'm using this to revise before an interview.
Good luck with your interview!
8:40 that is babeljs yes? ecma 2015? use of $?
its ECMA 2015 use of ${} is called template strings.
Finally understood callback...after watching this video...thanks a Lot
this is such a life saver video! your video is so easy to understand! thank you so much!!!!
Thanks, its really the best explanation for callback functions - i watched a few videos and didnt get it till yet
You explained "Why" we use them rather than just "How" (which is less significant). Thank you.
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.
THanks for watching Julian!
The best explanation i have found so far. Really good thankyou so much!!!
After writing node application for one year, i now understand what a callback is
Wow. Node is all callbacks.. that happens. :)
Thanks for sharing. Callbacks have been driving me up the wall.
I am glad that it cleared up the concept of callbacks. :)
What an awesome video!! I actually understand functions after watching several videos.
Thanks for watching!
I've really struggled to understand callback functions and I'm still not 100% but this video really helped! Thanks
Thank you so much, you gave such a clear and easy to follow explanation of callback functions.
I really like the way to teach stuff, its comprehensive and clear, thanks for taking time to make these videos.
finally someone explained callbacks! thanks!
I really understand these mysterious functions now! Thank you for de-mystifying them.
your video has made call backs so simple for me!!! Thanks in tonnes ..
I am glad that you learnt Prerna. Thanks for watching! :)
Dude. Never knew you can do that. Awesome. Keep it up. If no one likes it people like me would like it.👍🏼
Ramazan, I really appreciate the like , thank you!
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?
Most important he explained when exactly it is useful! Thanks
this is the best video so far i watched
great video lesson. Thank you.
just out of curiosity what were the -1 and 1 you were returning (for IF and else respectively) in the last segment of the lesson where you sorted the array based on an anonymous function?
the returning -1 or 1 decides the order it will sort for that particular field.
Thank you, I now have a good understanding of callback functions
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.
just loved the explanation, thank you sir.
Devendra, thanks for the comment! Keep on learning!
Thanks for making it simple. Although i am having doubt. Instead of passing callbavk function. We could have call add and multiply function inside calc function
So how it is different to call callback function instead of calling function directly.
Can you please explain it?
I think it's a way of creating abstractions.
Javascript doesn't have "abstract" or "interface" functions.
Passing a function as a parameter seems to be the way they handle it.
Such a good explanation. Good work man ;)
Thanks for watching Martin.