Thanks this is interesting, I don't know why but when I look at this I think of pattern matching, does JS support pattern matching?
It doesn't exist like that right now. However it's proposed to the tc39 and this proposal is currently in Stage 1.
github.com/tc39/proposal-pattern-m...
Apparently there are several tries to implement it but I think they are simple patches until it's completely adopted.
bramstein.com/writing/pattern-matc...
Thanks for looking into it :).
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks this is interesting, I don't know why but when I look at this I think of pattern matching, does JS support pattern matching?
It doesn't exist like that right now. However it's proposed to the tc39 and this proposal is currently in Stage 1.
github.com/tc39/proposal-pattern-m...
Apparently there are several tries to implement it but I think they are simple patches until it's completely adopted.
bramstein.com/writing/pattern-matc...
Thanks for looking into it :).