Hacker News new | ask | show | jobs
by melony 1106 days ago
What do also and use do?
1 comments

Kotlin has a bunch of scope functions[0]. `a.also(f)` takes a function `f`, calls `f(a)`, and returns `a`.

[0]: https://kotlinlang.org/docs/scope-functions.html