Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
nsajko
5y ago
0 comments
Share
You choose to interpret a
switch statement
through an
if statement
, but that's arbitrary: the other way around is also possible (interpreting/rewriting an if-else construction as switch statements).
0 comments
default
newest
oldest
jfkebwjsbx
5y ago
The point of GP is that the match assumes an equality test and it does it against a single object too.
There is no way in many languages to write an if using a match.
j
/
k
navigate · click thread line to collapse