PBS 82a async/await Demo

A worked example that makes use of the async & await for instalment 82 of the Programming by Stealth series.

This page is intended to be interacted with via the JavaScript console.

Example 1 — A Random Number of Random Numbers

Click the button below to use an asyn function to first fetch a random number between 1 and 5 via one AJAX call, and then fetch that many random numbers between 1 and 100 in parallel via more AJAX calls.

Worked Example — Weather

Click the button below to use an async function to first geoloate your IP via one AJAX call, and then get the weather for your city via another.

Output Area