Nav

minBy

minBy(Array<T>, (item: T) → Comparable): T | Null

Returns the element used to get the minimum result using a function. Return null when array is empty

Transform

        
     
1
2
3
4
%dw 2.0
output  application/json
---
[ { a: 1 }, { a: 2 }, { a: 3 } ] minBy (item) -> item.a
Output

        
     
1
{ "a": 1 }