May 12, 2023
Another option can be reduce.
%dw 2.0
output application/json
fun sumOfDigits(number) = number reduce ((item, accumulator) ->
accumulator+item
)
---
sumOfDigits(498) as Number
Another option can be reduce.
%dw 2.0
output application/json
fun sumOfDigits(number) = number reduce ((item, accumulator) ->
accumulator+item
)
---
sumOfDigits(498) as Number
Engineering Leader at Tricon Infotech Private Limited | Mulesoft Certified Developer and Architect