hardJS ES6+#66

Async generator with for-await-of

Prompt

Create an async generator that yields numbers 1 to 5 with a short delay (50 ms) between each. Write consume() that collects them with for-await-of and returns the array.

Hints

Solution

Your Code

10 min

Tests

Click Run to test your code