Skip to content

TodayILearned- 2023-03-28

Posted on:March 28, 2023 at 12:13 PM

TIL

JavaScript is single-threaded:

Come forward, asynchronous code execution

e.g. eventListener - we’re actually adding the event listener and are handing it off to the browser so that once the browser detects the event, it has the callback function to run (to let JavaScript know event has occurred).

Stack - think, STACK of PANCAKES.

Queue - PEOPLE waiting in queue.

Event loop (within the host environment)

Note:

Asynchronous operations are one of those things that really make my brain itch — but I’m glad that compared to last year, I have a much better understanding of the event loop, stack, and task queue now.

Resources I used: