Région de recherche :

Date :

https://developer.mozilla.org › fr › docs › Web › JavaScript › Reference › Statements › async_function

async function - JavaScript | MDN - MDN Web Docs

Une fonction asynchrone est une fonction précédée par le mot-clé async, et qui peut contenir le mot-clé await. async et await permettent un comportement asynchrone, basé sur une promesse (Promise), écrite de façon simple, et évitant de configurer explicitement les chaînes de promesse.

https://developer.mozilla.org › ... › docs › Web › JavaScript › Reference › Statements › async_function

async function - JavaScript | MDN - MDN Web Docs

The async function declaration creates a binding of a new async function to a given name. The await keyword is permitted within the function body, enabling asynchronous, promise-based behavior to be written in a cleaner style and avoiding the need to explicitly configure promise chains.

https://javascript.info › async-await

Async/await - The Modern JavaScript Tutorial

Await. The syntax: // works only inside async functions let value = await promise; The keyword await makes JavaScript wait until that promise settles and returns its result. Here’s an example with a promise that resolves in 1 second:

https://www.w3schools.com › Js › js_async.asp

JavaScript Async - W3Schools

The await keyword can only be used inside an async function. The await keyword makes the function pause the execution and wait for a resolved promise before it continues: let value = await promise;

https://www.pierre-giraud.com › javascript-apprendre-coder-cours › async-await

Utiliser async et await pour créer des promesses plus lisibles en ...

Les mots clefs async et await sont un sucre syntaxique ajouté au JavaScript pour nous permettre d’écrire du code asynchrone : ils n’ajoutent aucune fonctionnalité en soi mais fournissent une syntaxe plus intuitive et plus claire pour définir des fonctions asynchrones et utiliser des promesses.

Utiliser async et await pour créer des promesses plus lisibles en ...

https://fr.javascript.info › async-await

Async/await - JavaScript

Il existe une syntaxe spéciale pour travailler avec les promesses d’une manière plus confortable, appelée “async/await”. Elle est étonnamment facile à comprendre et à utiliser. Fonctions asynchrones. Commençons par le mot-clé async. Il peut être placé avant une fonction, comme ceci:

https://developer.mozilla.org › fr › docs › Web › JavaScript › Reference › Operators › await

await - JavaScript | MDN - MDN Web Docs

L'expression await interrompt l'exécution d'une fonction asynchrone et attend la résolution d'une promesse. Lorsque la promesse est résolue (tenue ou rompue), la valeur est renvoyée et l'exécution de la fonction asynchrone reprend.

https://www.sitepoint.com › javascript-async-await

A Beginner’s Guide to JavaScript async/await, with Examples

The async and await keywords in JavaScript provide a modern syntax to help us handle asynchronous operations. In this tutorial, we’ll take an in-depth look at how to use async/await to...

A Beginner’s Guide to JavaScript async/await, with Examples

https://www.javascripttutorial.net › javascript-async-await

JavaScript Async / Await: Asynchronous JavaScript - JavaScript Tutorial

The await keyword can be used only inside the async functions. The following defines an async function that calls the three asynchronous operations in sequence: async function showServiceCost ( ) { let user = await getUser( 100 ); let services = await getServices(user); let cost = await getServiceCost(services); console .log( `The service cost ...

https://dev.to › camskithedev › master-asyncawait-in-javascript-a-practical-guide-for...

Master Async/Await in JavaScript: A Practical Guide for Asynchronous ...

When an async function is called, it returns a promise. Inside the async function, you can use the await keyword to wait for a promise to resolve. If the promise resolves, the value of the promise is returned. If the promise is rejected, an error is thrown.

Master Async/Await in JavaScript: A Practical Guide for Asynchronous ...