Certain JavaScript functions behave asynchronously

An asynchronous function pauses its execution, allows other code statements to execute, and then resume. Asynchronous functions may be used to manage timers or to to fetch data. These functions return before they are completed, but resume execution (usually through a callback function) at the appropriate time (after a certain interval, or after data has been retreived).

For example, the function call setTimeout(callback, ms) will execute the function callback() after ms milliseconds.

For more information, see the w3schoosl Async tutorials starting with https://www.w3schools.com/js/js_callback.asp