“JavaScript attend un mot-clé” Réponses codées

JavaScript vous attend

await new Promise(resolve => setTimeout(resolve, 5000)); // 5 second wait

//or

(async () => {
await new Promise(resolve => setTimeout(resolve, 5000)); // 5 second wait
})();
Pudochu

attendre javascrip

If the value of the expression following the await operator is not a Promise, it's converted to a resolved Promise.
Smoggy Swiftlet

JavaScript attend un mot-clé

let result = await promise;
SAMER SAEID

js attend

const a = async () => {	
  	await b();
  	c();
};
Solstice

attendre javascrip

The await operator is used to wait for a Promise. It can only be used inside an async function within regular JavaScript code; however it can be used on its own with JavaScript modules.
Smoggy Swiftlet

Réponses similaires à “JavaScript attend un mot-clé”

Questions similaires à “JavaScript attend un mot-clé”

Plus de réponses similaires à “JavaScript attend un mot-clé” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code