TL DR difference
alsothe function gets the lambda to which it Tis passed in the implementation, so inside the lambda you will access it with a name ( itby default, you can rename it { otherName ->...}).
val person = Person().also {
it.name = "Tony Stark"
}
apply, , , , . this.
val person = Person().apply {
name = "Tony Stark"
}
:
inline fun <T> T.also(block: (T) -> Unit): T (source)
this () this ().
:
inline fun <T> T.apply(block: T.() -> Unit): T (source)
this this ().
.