control-flow-forof-assign-form.ts 309 B

12345678
  1. // for...of with an ASSIGNMENT-form initializer (pre-declared variable, no
  2. // declaration list): the loop variable receives each element at runtime.
  3. const notes = await agent("scan").ask<string[]>("list issues");
  4. let cur = "";
  5. for (cur of notes) {
  6. log(cur);
  7. }
  8. return agent("fix").ask<string>(`fix ${cur}`);