Back
Close

JavaScript, async and await keywords

Magus
6,231 views
Next: A first example

Before starting this playground, you must know how promises work in JavaScript. If you want to learn this, you can use the playground JavaScript promises, mastering the asynchronous.

Environment

In this playground, we'll talk about two new JavaScript keywords: async and await. Keep in mind that these keywords are not supported in every JavaScript environment. When you want to know if a JavaScript feature is supported by a browser, use http://caniuse.com. As you can see, the async and await keywords are supported by a majority of up-to-date browsers. But of course, Internet Explorer does not support them. Since async and await are keywords, we can't really use a polyfill to fix that. But if you want to target an old browser and you want to code with the async and await keywords, you should use the Babel compiler.

In this playground, we run the code in a NodeJS 8+ environment. So async and await are natively supported.

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants