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 actually single threaded because every JavaScript code will run in a single thread (that's not true anymore in the modern web because [Web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) allow JavaScript code to run in separate threads, though). That means there is a single callback queue, and the callbacks run when the main thread is not busy, and thus can potentially be delayed. Also, note that the UI (web page) is blocked while JavaScript runs, preventing the user from doing anything.

All of the browser's internal mechanisms such as `XMLHttpRequest` are not JavaScript, only the API is (`send()`, `open()`, `onreadystatechange`, etc.), so it's up to the browser's editor to make use of other threads for these internal mechanisms, as long as the API complies with the W3C specification.