Kotlin List tail function
Kotlin doesn’t have a built-in List<T>.tail() function, so implementing your own extension function is the only way. Although your implementation is perfectly fine, it can be simplified a bit: fun <T> List<T>.tail() = drop(1) Or, instead of extension function, you can define an extension property: val <T> List<T>.tail: List<T> get() = drop(1) val <T> List<T>.head: … Read more