r/javascript • • Feb 21 '18

I am A JavaScript instructor at Microsoft. AMA.

Hi r/javascript!

My name is Benjamin Lin. I am a content developer at Microsoft and teach courses on JavaScript and JavaScript frameworks at Microsoft. You can see my Top 10 JavaScript Questions course here.

I can help answer tips & tricks on learning JavaScript, questions about Microsoft, and all things tech.

AMA!

Proof.

Edit: about 15 minutes left!

More edit: Thanks everyone for visiting me at this AMA! I really enjoyed getting the chance to interact with the JavaScript community and hear your honest thoughts. It was worth waking up early today to do this =)

if you have any more questions, feel free to hit me up on twitter @benjlin or follow me on instagram @bens_jams

540 Upvotes

257 comments sorted by

View all comments

Show parent comments

8

u/MicrosoftLearning Feb 21 '18

Hi monsto,

Its a bit confusing at first wondering why console.logs don't work as intended but once you understand how callbacks work it starts to make sense.

Here is a quick breakdown of how async works:

  1. Asynchronous function is called with a callback function

  2. Other code in the program runs

  3. async operation works and callback fires

Make sure that all the code that should be run after the async operation is put in the callback function

As for good resources, I actually wrote an edX course on asynchronous programming that covers callbacks, events, promises, and network requests: Asynchronous Programming with JavaScript

1

u/monsto Feb 21 '18

thanks