find_exp

v10.11.0

Return the first object in an array for which the given expression evaluates to true or return nil if no item in the array satisfies the evaluated expression.

1
2
3
4
5
const members = [
{ graduation_year: 2013, name: 'Jay' },
{ graduation_year: 2014, name: 'John' },
{ graduation_year: 2014, name: 'Jack' }
]

Input

1
{{ members | find_exp: "item", "item.graduation_year == 2014" | json }}

Output

1
{"graduation_year":2014,"name":"John"}