Question: I have learned that, JavaScript is always single-threaded. If you're executing a JavaScript block of code on a page then no other JavaScript on that page will currently be executed.
If this is the case then how Javascript manage Ajax call? If a single thread is busy and currently executing other Javascript on that page then how thread manage when call return(success or otherwise) from ajax? Is Javascript internally uses more than a thread to handle call return?

Answer: 
The javascript *engine* itself is single threaded, but javascript executes in a **hosting environment** that includes more than just the js engine. A hosting environment would be something such as a browser, a server, etc.

Within the hosting environment is something called an event loop. This event loop manages when certain parts of a js script should run. So when you write something such as:

```
setTimeout(() => console.log('tick'), 1000)

```

the callback function gets put on the event loop (not quite, but close enough for explanation purposes) and once the current js execution thread is empty the event loop will check if there is anything in the queue and if there is it will push it onto the main js execution thread.

So in summary, the js engine itself is single threaded but there is a lot more that goes into a full js hosting environment that makes it work.
JavaScript is single-threaded with respect to the code that is executed within one context. So in a JavaScrip Engine code of the same context cannot run in parallel. You can have multiple contexts running in parallel (like WebWorkers), but different contexts cannot share objects (or only in a clearly define and limited way).

The IO is implemented with an event-based approach, which means, that out of the perspective of the JavaScript side, data is pushed to or pulled from a buffer. How that buffer is filled/emptied is not in the JavaScript Land anymore, and at that point, the engine could use threads, or continue to use an event-based approach like libuv (which is used by V8 the js engine of chrome and nodejs) provides. libuv or the system then itself would do something with the data, which again could either be done with threads or event-based.

So, in theory, the IO could be done completely without threads.