Member-only story
Kotlin Advanced Programming Part 2
A journey to Kotlin Functional Programming
If you are new to Kotlin please check out my previous posts Kotlin Guide for Beginners and Kotlin Advanced Programming and move forward for better understanding. In this post let’s check some advanced concepts related to the functional programming of Kotlin.
Unit-returning functions
In Kotlin every function has function type. If the function returns nothing then the function return type is Unit. It’s optional to specify the Unit return type explicitly. It’s similar to void in the case of Java.
Functions with Varargs
A function that accepts a variable number of arguments (varargs).
The above function can be called by passing n number of params of type T