Forum Discussion
BenKanspedos-8b
3 years agoCommunity Member
Display value of variable with line-breaks when populated from javascript
I'm working on a template project where the variables get populated from a javascript that defines and adds the values to the variables. There is one variable that will often be quite long. I wan...
MathNotermans-9
3 years agoCommunity Member
Looks solid. Recapping how i think it works ( should work ) checking your images.
- sentences are split on a .
- all sentences are added to formattedCxScenario
- a . is added to the end.
- i is checked
- when (i +1) % 3 === 0 it will return true
- when true a <br> is added.
Looks correct...
I would add a console.log("i : "+i);
to check if i is the value you need...
add it just before the if and in the check...so you can see the result.