Expand my Community achievements bar.

Never miss an update of the Adobe Journey Optimizer Community Lens! Subscribe now to get the latest updates, insights, and highlights delivered straight to your inbox every time a new edition drops.
SOLVED

Basic for loop

Avatar

Level 2

I am new to AJO and would like to code a basic for loop, something like this in JavaScript,

 

for (let i = 0; i < cars.length; i++) {
  text += cars[i] + "Car";
} 

 

Any suggestions?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@GeorgeVi2 You don't have for loop. Instead, see if you can use each function to see if that helps. Take a look at this documentation,

https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...

Thanks, Sathees

View solution in original post

2 Replies

Avatar

Employee Advisor

You can take a look at this link https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio... for reference examples on iterating over arrays / object arrays.

Avatar

Correct answer by
Community Advisor

@GeorgeVi2 You don't have for loop. Instead, see if you can use each function to see if that helps. Take a look at this documentation,

https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...

Thanks, Sathees