Both are scope functions, but they differ in object reference and return value.
thisval intent = Intent().apply {
action = Intent.ACTION_VIEW
data = Uri.parse("https://google.com")
} // Returns the configured Intent
thisval length = with(person) {
println(name)
println(age)
name.length // Returns this Int
}
Mark this when you can explain the answer in your own words.
Help fellow developers prepare for interviews
Sharing helps the Android community grow ๐