Let us understand this with the help of an example.
In the above code snippet, the first line of the code
Hi will be logged first then the second line
Mayukh will be logged and then after its completion, the third line would be logged
How are you.
So as we can see the codes work in a sequence. Every line of code waits for its previous one to get executed first and then it gets executed.
So, what the code does is first it logs in
Hi then rather than executing the
setTimeout function it logs in
End and then it runs the
At first, as usual, the