19 Loops without loops

The “Scala” way (or Functional way) of performing a sum of numbers. Many programming tasks can be written in Scala using similar concepts without the use of explicit while loops.


0
//Or, neither while nor for  
1
(0 until 10).sum  
2
 
 
Code editor is using Scalakata.com written by Guillaume Massé