JavaScript is a single-threaded engine which means that one thing can happen at one time. To run such concurrency in a Javascript code, we use asynchronous calls. JavaScript creates a stack where all of the functions are being run as code. Javascript creates an environment which calls the main() function. This environment is like a stack on top of which the displayMessages() function is added. The displayMessage() function holds a set of functions. The first one that is executed is myFunctionOne() therefore it is added on the top of the execution stack.
Coin Mentioned
Muhammad Bilal
@th3n00bc0d3r
Founder BreatheIO, PGP AI/ML from UTA, 10+ Year Full Stack HW & SW Engineer, Author 2 x Books, 3 x Advisor Startup