Recursive methods in Scala
Get started functional programming in Scala.
There is a lot of debates about functional programming vs object oriented programming. This post we will not discuss such thing. Instead we just go over how to do simple recursive functions in Scala.
In Object Oriented Programming, we usually mutate the value and therefore we often go with for loop or while loop. In functional programming, we will not use loops, instead we use recursive methods.