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.
while
//Or, neither while nor for
(0 until 10).sum