📜  Also 和 let4 之间的不同 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:37.957000             🧑  作者: Mango

代码示例1
data class Person(var name: String, var tutorial : String)
var person = Person("Anupam", "Kotlin")

var l = person.let { it.tutorial = "Android" }
var al = person.also { it.tutorial = "Android" }
    
println(l)
println(al)
println(person)