Created
November 5, 2016 14:14
-
-
Save sliskiCode/e15dfba92f4575512e385a3a5bba2928 to your computer and use it in GitHub Desktop.
Quick dive in Kotlin extensions 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val collection = listOf("Piotr", "Slesarew") | |
| collection.reversedForEach(::println) | |
| fun <T> Iterable<T>.reversedForEach(action: (T) -> Unit): Unit { | |
| for (element in this.reversed()) action(element) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment