0
Q:

kotlin curly braces after function call

// put whole lambda in parentheses
list.any({ i: Int -> i > 0 })
// if its the last parameter, you can move lambda out of parentheses
list.any() { i : Int -> i > 0}
// if its the only parameters, you can remove parentheses
list.any { i: Int -> i > 0 }
// if lambda has the only argument, you can replace its name with 'it'
list.any{ it > 0 }
0

New to Communities?

Join the community