The pattern matching is basically a switch
on steroids, you can create powerful conditions such based on Object
properties or Array
content without manipulating the Object
or Array
itself.
Benefits
Avaiable Patterns
(x = 1) =>, (x = null) =>, (x = 'true') =>
(x = {a: 1}) =>, (x = [1, 2]) =>
(x = String) =>, (x = Boolean) =>
(x = Date) =>, (x = Person) =>
(head, tail) =>
, (a, b, c, tail) =>
, etc…