Shorthand Functions
suggest changeIf a function contains just one expression, omit the braces and use = instead, as in an assignment. The result of the expression is returned automatically.
fun sayMyName(name: String): String = "Your name is $name"
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents