Pattern Matching Magic
Briefly

Pattern matching is checking a value against a pattern. The pattern could be a constant, a variable, a constructor of a case class or even more complex combinations.
Scala uses match expressions for pattern matching. For example matching a number to a month of the year: val monthIndex: Int = 7 ... case _ => "Not A month" // Default case
Read at Medium
[
add
]
[
|
|
]