You have a few options:
_
as a throwaway variable (common convention)forawait (const _ of asyncIterable);
Most ESLint configurations will allow _
to be unused (it's a convention for "I don't care about this value").
Unfortunately, this is not valid syntax in JavaScript
So you must declare a variable, even if unused.
If you don't want to rename the variable
.forEach()
-like utility instead (if available)If the library (e.g. ixjs
) provides a forEach
method, you can do:
await asyncIterable.forEach(() => {});