Functions help you organize code into reusable blocks. Letβs check out how to define and use them.
return
fun add(a: Int, b: Int): Int { return a + b }
val result = add(2, 3)
fun double(x: Int) = x * 2