Asynchronous

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/13

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

14 Terms

1
New cards

Call Stack

A stack data structure that keeps track of function execution.

2
New cards

Event Loop

A mechanism that checks the call stack and pushes tasks from queues when the stack is empty.

Managing asynchronous operations (like timers, API calls, user clicks) without blocking the main program flow

3
New cards

Macro-task queue

Queue for tasks like setTimeout, setInterval, DOM events.

4
New cards

Microtask Queue

Queue for Promise callbacks (.then, .catch, .finally) and queueMicrotask.

5
New cards

Priority: microtasks vs macrotasks

Microtasks are executed before macrotasks.

6
New cards

Execution order

Call stack → Microtasks → Macrotasks.

7
New cards

Promise

An object representing the eventual completion or failure of an asynchronous operation.

8
New cards

async function

A function that always returns a Promise.

9
New cards

await

Pauses execution of an async function until a Promise resolves or rejects.

10
New cards

async/await vs .then()

async/await is syntactic sugar over Promises and makes async code easier to read.

11
New cards

Promise states

Pending, Fulfilled, Rejected.

12
New cards

Promise.all

Resolves when all Promises resolve; rejects if any Promise rejects.

13
New cards

Promise.allSettled

Resolves when all Promises settle, returning their outcomes.

14
New cards

Are Promises async by default?

Promise executor runs synchronously, but .then callbacks are async.