1/4
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What are the three states of a Promise?
Pending, fulfilled, rejected. Once it settles (fulfilled or rejected) it can't change.
What does .then() do, and what does .catch() do?
.then() runs when the Promise fulfills and receives the resolved value. .catch() runs when it rejects and receives the error. They can be chained.
Why does Promise.all() exist? What does it return?
Runs multiple Promises in parallel and waits for all to fulfill. Returns one Promise resolving to an array of all results. If any one rejects, the whole thing rejects immediately.
What is the difference between synchronous and asynchronous code?
Synchronous runs line by line, each blocking the next. Asynchronous starts a task and moves on, handling the result later via a callback/Promise — so slow operations don't freeze everything.
Why is JavaScript single-threaded but still non-blocking? definition start: One call stack runs one thing at a time, but slow operations are handed off to the environment
their callbacks wait in a queue and the event loop runs them only when the stack is clear.