Monday, November 12, 2018

JavaScript Event Loop Explained

JavaScript Event Loop Explained

Now for the long answer, let me try through 2 sample code snippets. Here we have the main function which has 2 console.log commands logging ‘A’ and ‘C’ to the console. Sandwiched between them is a setTimeout call which logs ‘B’ to the console with 0ms wait time.

No comments:

Getting Started

Let's get started by writing a test for a hypothetical function that adds two numbers. First, create a sum.js file: Then, create a fil...