Single Expression Functions
Single-line functions (also known as one-expression functions) in Kotlin are functions that consist of only one expression and are defined without curly brackets {}. They help improve the readability and compactness of the code, especially for simple and short functions. The syntax of a Single Expression Function in Kotlin has the following structure: fun – The keyword to define a function. functionName – The name of the function.
Read more