The Javascript Event Loop episode artwork

EPISODE · Dec 25, 2021 · 28 MIN

The Javascript Event Loop

from Kutad Gubilik's Listen Later · host Vincent Tang & German Gamboa

Podcast: Code Chefs - Hungry Web Developer PodcastEpisode: The Javascript Event LoopPub date: 2020-08-22Get Podcast Transcript &#8594;powered by Listen411 - fast audio-to-text and summarizationHow does Javascript handle concurrency? When you execute asynchronous code in Javascript, it goes through something called an Event Loop. It describes in what order your code will run by using a call stack and a callback queue. This is important to understand so you don't run into race conditions in your codebase. In this episode, we deep dive into how it all works! Shownotes <!-- - 00:30 - Intro - 00:40 - Testing - 00:50 - Testing --> 01:30 - Basics and why it matters Javascript is single threaded The event loop gives it Javascript the ability to handle concurrency and async code It's useful for describing animation states 07:30 - The mechanics Browser initializes with v8 engine The event loop runs, and code executes top to bottom Two concepts - callstack and heap Callstack is FIFO (Last in first out) - like a stack of pancakes It describes when callbacks will occur when things are finished in that execution When nothing is left over in the callback queue, everything has been executed 12:30 Examples: console.log("hello"); setTimeout(() => { console.log("resolve timeout"); },5000) console.log("last line"); Hello is logged, then resolve timeout is placed into a callback queue. last line is then logged. 5 seconds later, the callback queue is checked, and resolve timeout is logged. What if you had a long list of executable code, and a setTimeout with a very short duration called in the middle? console.log(1); console.log(2); console.log(3); setTimeout(()=> { console.log("set time out function") }, 100); //..... console.log(1000); The setTimeout function will still execute after all other code runs. 16:50 - Additional notes For async await, understand the order in which your promises are resolving. If two HTTP calls can be executed in parallel, use Promise.all() Stack vs Heap in Event Loops 22:00 - Dessert Time 22:40 - Swimming with Vincent 24:00 - Linux OS and GPUs with German Social Media German's Twitter Vincent's Twitter Vincent's Instagram Tweet us your thoughts on @codechefsdev Links The event loop playground Overview of Event Loops The podcast and artwork embedded on this page are from Vincent Tang & German Gamboa, which is the property of its owner and not affiliated with or endorsed by Listen Notes, Inc.

Podcast: Code Chefs - Hungry Web Developer Podcast Episode: The Javascript Event Loop Pub date: 2020-08-22 Details: https://www.listennotes.com/e/f243b71f4cba47eaba141e11256c69c6/ The podcast and artwork embedded on this page are from Vincent Tang & German Gamboa, which is the property of its owner and not affiliated with or endorsed by Listen Notes, Inc.

NOW PLAYING

The Javascript Event Loop

0:00 28:12

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

French Your Way Jessica: Native French teacher founder of French Your Way Boost your French listening skills and test your comprehension with this one of a kind series of podcasts. Get the chance to listen to a real conversation between native speakers talking at normal speed AND customise your learning experience through carefully designed sets of questions (2 levels of difficulty) available for download at www.frenchvoicespodcast.com. All interviews also come with the transcript. French teacher Jessica interviews native speakers of French from around the world who share a bit of their life and passion. Where else would you meet in one same place a French yoga teacher based in Melbourne, a soap manufacturer from Provence, or a couple cycling around the world? Why That with Wyatt Wyatt Your semi-weekly source for fun facts and deep dives into different topics! Please follow the show and share the link with anyone who doesn’t already listen! Tips, News and Stories for Older Adults Esther C Kane CAPS, C.D.S. "Tips, News, and Stories for Older Adults" delivers weekly insights tailored for seniors. We bring you summaries of curated news, practical advice, and inspiring stories that matter to the 55+ community. From health and finance to technology and lifestyle, our content keeps you informed and engaged. Sourced from trusted outlets, each episode offers valuable information for navigating your golden years. Join us as we explore aging with positivity, wisdom, and engaging stories. Your perfect companion for staying active, learning, and embracing life's later chapters. 2 Old Ladies Walking Rozee 2 Old Ladies Walking features the journeys, insights, and light conversation between Liz and Rosie, two women of a certain age who live in the Hudson Valley of New York. From pelvic floor challenges and life with young adult children to food, bird calls, fear of “mad lamb” disease, and myriad topics in between, we cover it all while walking on the scenic trails of the northeast, or wherever our travels take us. Join us and have a listen!

Frequently Asked Questions

How long is this episode of Kutad Gubilik's Listen Later?

This episode is 28 minutes long.

When was this Kutad Gubilik's Listen Later episode published?

This episode was published on December 25, 2021.

What is this episode about?

Podcast: Code Chefs - Hungry Web Developer PodcastEpisode: The Javascript Event LoopPub date: 2020-08-22Get Podcast Transcript →powered by Listen411 - fast audio-to-text and summarizationHow does Javascript handle concurrency? When you execute...

Can I download this Kutad Gubilik's Listen Later episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!