Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST

Basic JavaScript

JS Tutorial JS Syntax JS Variables JS Operators JS If Conditions JS Loops JS Strings JS Numbers JS Functions JS Objects JS Scope JS Dates JS Temporal Dates JS Arrays JS Sets JS Maps JS Iterations JS Math JS RegExp JS Destructuring JS Data Types JS Errors JS Debugging JS Conventions JS References JS ECMAScript 2026 JS Versions

JS HTML

JS HTML DOM JS Events JS Projects

JS Advanced

JS Functions JS Objects JS Classes JS Asynchronous JS Modules JS Meta & Proxy JS Typed Arrays JS DOM Navigation JS Windows JS Web APIs JS AJAX JS JSON JS jQuery JS Graphics JS Examples JS Reference


Asynchronous JavaScript


Step 1

Async Programming

JavaScript executes code one line at a time. Each line must finish before the next line can run.

Asynchronous is how JavaScript can allow some code to run in the background, and let their results be handled when they are ready.

Beginner


Step 2

Async Timeouts

The setTimeout() method schedules a function to run after a delay in milliseconds.

It is an asynchrounus operation used to delay code execution without freezing the browser.

Beginner


Step 3

Async Callbacks

A callback is a function that runs later.

The name "callback" stems from the idea that the function will "call you back" later when it has finished its task.

Intermediate


Step 4

Async Promises

JavaScript Promises were created to make asynchronous JavaScript easier to use.

A Promise object represents the completion or failure of an asynchronous operation.

A Promise can be in one of three exclusive states: pending, rejected or fulfilled.

Advanced



Step 5

Async Await

async and await make promises easier.

You still use promises, but you write the code like normal step by step code.

async makes a function return a Promise

await makes a function wait for a Promise

Advanced


Step 6

Async Fetch

Modern apps use async code to get data.

fetch() is the modern way to request data from a server.

fetch() is asynchronous and returns a promise.

Advanced


Step 7

Async Debugging

Asynchronous bugs are difficult because the code runs later.

This chapter shows practical ways to debug fetch(), promises, async and await.

Advanced


Step 8

Async References

All Promise Object Methods

Revised February 2026

Advanced



×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.

-->