`

Transpiling forEach to a for loop

This does not mean that forEach is bad and must necessarily be replaced!

In computations, forEach is transpiled into a for loop.

If forEach is used in a computation within a task, as shown in the example below (push), an infinite loop occurs. This happens because, with each iteration, a new element is added using push, and the for loop does not fix the array length at the start, leading to an infinite loop.

let POs = invoiceItems.POnumber;
          POs = lodash.map(POs, "value");
          // Adding iprocIdPOCO to the array
          POs.forEach((item) => {
              POs.push(iprocIdPOCO);
          });

Anna Gernát Updated by Anna Gernát

Editing Task Description vs Task Instructions

Rendering HTML on Caseoverview

Contact

Syca (opens in a new tab)

Powered by HelpDocs (opens in a new tab)