I think one could make the case it adds value by reducing the need to repeat the same name twice, thus reducing the potential for errors.
I'm not sure it's worth it given how nontraditional it is, and I think JS devs typically do not think of functions as objects as it is being used here, but still it's an interesting approach
This specific scenario isn't all that convincing, but IMO in general it's safer to be more expressive with less repetition than not, because it reduces the opportunity for subtle errors in the future.
-6
u/OmgImAlexis Nov 10 '20 edited Nov 10 '20
It’s harder to read the intent and doesn’t add anything helpful for the few chars it saves.