Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SCALA

how loop in scala

val nameMap = Map("firstName" -> "Ed", "lastName" -> "Chigliak")
for ((k,v) <- nameMap) {
    println(s"key: $k, value: $v")
}

val result = for ((k,v) <- nameMap) yield {
    s"key: $k, value: $v"
}
println(result)
Source by alvinalexander.com #
 
PREVIOUS NEXT
Tagged: #loop #scala
ADD COMMENT
Topic
Name
7+6 =