But it's not a switch, it's called "Pattern Matching."
Pattern matching is way beyond the "Switch Statement"
π
The pattern matching takes a value following match and allows us to write out several potential cases, each defined by case. Where we find a match between the match-case we will execute the respective code. #programming π
Even though it is not a "switch", it can be used as.π
You can use patterns to match even more complex structures, like tuples, lists etc. You can nest them. You can have redundancy checking. #coding
β’ β’ β’
Missing some Tweet in this thread? You can try to
force a refresh