joshua-r2
10/17/2017 - 8:20 PM

Returning a Function from a Function

The key here is -> Object = {...}

fun reverseDoggo: (String) -> String = {str->str.reversed()}

//To call reverseDoggo we assign a Function to a value

val whatCouldItBe = reverseDoggo()
whatCouldItBe("Shibe") //returns ebihS