in this lambda `{ x: Int, y: Int -> x + y }` we...
# getting-started
p
in this lambda
{ x: Int, y: Int -> x + y }
we can explicitly specify the type of parameters. Can we also specify the return type?
a
poohbar: nope, its not possible to declare the return type of a lambda. you need to use the following syntax:
ints.filter(fun(item) = item > 0)
https://kotlinlang.org/docs/reference/lambdas.html#anonymous-functions
👍 1