Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

countBy

countBy(Array<T>, (T) → Boolean): Number

Counts the matching elements using a matchingFunction(T)

Transform

        
     
1
2
3
4
%dw 2.0
output application/json
---
[1, 2, 3] countBy (($ mod 2) == 0)
Output

        
     
1
1