My favorite is that if the object is in the outer scope, you can statically link to a value instead of having a function call with a hardcoded string argument.
In many cases this enables making definitions not recursive, like the example in my post:
I just wish other people were more accepting of this approach.
That's not always the case :v
I am glad you mentioned the pattern matching proposal, in my opinion the closest implementation of it in current JS is actually the early return pattern:
My favorite is that if the object is in the outer scope, you can statically link to a value instead of having a function call with a hardcoded string argument.
In many cases this enables making definitions not recursive, like the example in my post:
Another GOTO to avoid
Mihail Malostanidis
I just wish other people were more accepting of this approach.
That's not always the case :v
I am glad you mentioned the pattern matching proposal, in my opinion the closest implementation of it in current JS is actually the early return pattern:
It looks imperative at a glance, but with just a little discipline it serves the role very well.