In The Loop by Jake Archibald at JSConf.Asia 2018
A great, visually-instructive talk about the event loop and how your JavaScript actually gets executed by the browser. He has some great examples of gotchas that are worth wrapping your head around. Like this one: if the user clicks the button, in what order are things logged?
button.addEventListener('click', () => {
Promise.resolve().then(() => console.log('p1'));
console.log ('1');
});
button.addEventListener('click', () => {
Promise.resolve().then(() => console.log('p2'));
console.log('2');
}):
His descriptions of tasks, animation callbacks, and micro tasks, from the perspective of the browser, were all eye opening. Great talk for anyone doing JavaScript.