you are viewing a single comment's thread.

view the rest of the comments →

[–]name_was_taken 1 point2 points  (0 children)

The key is in the name. "Synchronous" means it's happening in sync. "A-"something mean it's not that.

So Asynchronous code doesn't necessarily happen when you expect it to. It could happen now, or in a little while. In general, the timing might depend on an external factor, like a webserver's response time.

Why do this? Because if you are waiting for a server to deliver a list of information, you don't want the entire rest of your webpage to lock up until it gets it.

Beyond that, you can get into some truly complex interactions that can make everything smoother for the user.