Home javascript Asynchronous in JavaScript

Asynchronous in JavaScript




I bang my head against the wall with an understanding of asynchrony.

  • Please tell me, is it possible to achieve asynchrony in JS without using timers (setTimeout)?
  • In theory, this is the same thread, pulling on which we can write asynchronous code?
  • And as I understand it, writing callbacks without using a timer is not advisable, because asynchrony will be lost?

Can you give an example of asynchronous code without using timers, promises, etc.?

Answer 1, authority 100%

Timers are just an example of an asynchronous call. There is synchronous execution – when they wait for the result of executing some function before starting another job. And there is asynchronous, when, accordingly, they do not wait, and begin to do something else

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions