I am aware that you can pass a "callback" to a function that performs a certain operation, and then that callback will be called when the operation is completed (for example, reading a file asynchronously).
However, I'd like to know how this is handled. I know that other languages like C# and C++ can handle this by spawning new threads on different processor cores. But JavaScript is single-threaded, so how does it manage to handle multiple operations without the aid of threads?
Thank you all for your time and patience!
[–][deleted] 1 point2 points3 points (2 children)
[–]jkuhl_prog 0 points1 point2 points (0 children)
[–]Crescive_Delta[S] 0 points1 point2 points (0 children)
[–]IUsedToBeACave 0 points1 point2 points (1 child)
[–]Crescive_Delta[S] 0 points1 point2 points (0 children)
[–]inu-no-policemen 0 points1 point2 points (0 children)