Created
June 6, 2018 09:05
-
-
Save sajjadyousefnia/2cd4063c8b1e484d5f96e276b1ef2f06 to your computer and use it in GitHub Desktop.
This file contains 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
fun surroundingFunction() { | |
val intList = listOf(1, 2, 3, 4, 5) | |
intList.forEach { | |
if (it % 2 == 0) { | |
return@forEach | |
} | |
} | |
println("End of surroundingFunction()") // Now, it will execute | |
} | |
surroundingFunction() // print "End of surroundingFunction()" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment