Enumerate on promise resolved

For the golfers out there, we can combine these two lines into one: const items = await getCollection (); return items . sort (); This doesn&rsquo;t work because sort() is being called on the promise returned by getCollection() : return await getCollection (). sort (); // `sort()` runs on the Promise Instead, wrap the await expression in parentheses so sort() is called on the resolved value:…