Skip to content
Learn Netverks

Lesson

Step 24/36 67% through track

promises-basics

Promises basics

Last reviewed May 28, 2026 Content v20260528
Track mode
client_javascript
Means
In-browser JS
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches Promises basics—the ideas, syntax, and habits you need before moving on in JavaScript.

Async JavaScript is non-negotiable for APIs and modern UIs—blocking the main thread still breaks production apps.

You will apply Promises basics in contexts like: Browsers, Node.js services, edge workers, and tooling ecosystems (bundlers, test runners).

Run JavaScript in the in-browser sandbox, use the terminal output panel, and verify with MCQs.

When the previous lesson's MCQs feel easy and you can explain Promises basics in your own words.

A Promise represents async work eventually settling as fulfilled or rejected. Chains use .then / .catch.

States

pending → fulfilled (value) or rejected (reason). Promise.resolve / reject create immediate outcomes.

Chaining

Return values from then pass to next then. Errors jump to nearest catch.

Important interview questions and answers

  1. Q: Promise vs callback?
    A: Promises flatten nested callbacks; easier error propagation.
  2. Q: Unhandled rejection?
    A: Always catch or try/catch with await—crashes Node, console errors in browser.

Self-check

  1. Name three promise states.
  2. Where do errors go in a chain?

Tip: Always handle rejections—.catch or try/catch with await.

Interview prep

Promise states?

pending, fulfilled, rejected.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What would you log to verify this behavior?
  • What breaks if you run this before the DOM is ready?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump