Questions in this sections are intended to give you a better understanding. I'm posting them here with the assumption that you will do your own research in figuring them out, and discuss with each other when you encounter a problem. The objective for you is not only to find the right answer, but to understand why.
When we run the following code, what do you think will be the precedence in the output window? Review the concepts of event loops, micro & macro tasks to answer this question.
Consider the code fragment below. What do you think will be the output when the code runs?
Consider the code fragment below. What do you think will be the output when the code runs?
Tip: The actual creation of the promise and the big while
loop still happens on the main thread, only the resolution happens as a micro-task
Consider the code fragment below. What do you think will be the output when the code runs?