What is the output?
fun greet(
name: String = "Guest"
) = "Hi, $name"
fun main() {
println(greet("Edith"))
println(greet())
}
Try it in the online Kotlin Playground →
[spoiler title="Solution"]
Answer:
Hi, Edith Hi, Guest
Explanation:
Default parameters provide values when arguments aren’t supplied.
[/spoiler]