Learn the difference between lambdas and higher-order functions.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4736-programming-in-kotlin/lessons/39
Learn the difference between lambdas and higher-order functions.
Audio is Missing after 0:33. I was really looking forward to the explanation, so I am a bit disappointed.
@shogunkaramazov that’s not what I meant. For me the video goes silent once the coding screen comes up. And it stays silent till the end. If I go back before the coding screen came up. The audio is back.
@shogunkaramazov In Chrome 71.0.3578.98, the sound of right ear has gone. I can listen the sound only on left ear.
@getogrand Thank you for the heads up. It works without issues for me in Safari, Chrome and Firefox. Does this happen to you in other browsers too?
Is there an equivalent to @escaping attribute in Swift, or capturing local variables? For instance:
let localVariable = ImportantClass()
func exampleFunction(operator: @escaping (Int) -> String) {
// Do stuff.
}
exampleFunction { [localVariable] in
// Do stuff.
}
One of the nice features of Kotlin is that you don’t need to use things like @escaping. Variables are captured by default if you use them.