Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pedrolopesme
Created June 11, 2017 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedrolopesme/35511fb7b8cffba802c31c5299968038 to your computer and use it in GitHub Desktop.
Save pedrolopesme/35511fb7b8cffba802c31c5299968038 to your computer and use it in GitHub Desktop.
fun main(args: Array<String>) {
var sum = 0
val myList = listof(1,3,6,7)
myList.forEach{ sum += it }
println(sum) // imprime 17
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment