Search This Blog

Sunday, August 7, 2022

Patterns code in Mule4

 pattern:

1

12

123

1234

Code:

%dw 2.0
output application/json
var a = ["1","2","3","4"]
---
a map ( (a reduce ($++$$) ) splitBy "" -- (a[-1 to ($$+1)] default []) orderBy $ joinBy "" )



1 comment: