I’ve been reading about callback functions here, and learned that JavaScript is a single-thread synchronous language.
This means that if you want to collect data from a database then you’d have to wait for the routine to finish before any more code was executed. Is this true? What would happen if the user pressed a button to call a different function in the same script file?
To make it asynchronous you can use callbacks. Asynchronous here would mean that a section of code in the callback would ‘wait’ for an event before being called but a new thread is not created.
What is it about being an Object
that makes JavaScript callbacks asynchronous?
It is the same as waiting for an event?