Forum Discussion
cjhoward18
4 years agoEmployee
Using a mapper and assuming your input text is at the key $text
you can use the following expression to achieve your goal:
$text.split("").reverse().reduce((accum, cur) => (accum.length - accum.split("+").length +1) % 3 == 0 ? accum + "+" + cur: accum + cur).split("").reverse().join("")