Skip to content

Conversation

@coolaj86
Copy link
Contributor

@coolaj86 coolaj86 commented Jul 3, 2022

It's confusing to use mathematical lambdas where you're not returning a value or doing math

It's confusing to use mathematical lambdas where you're not returning a value or doing math
@markin-io
Copy link

Arrow functions in JS could be used in any circumstances, there are no obligatory rules to return value or do the math.
I don't think that having this change is critical. @thephez it's up to you

@coolaj86
Copy link
Contributor Author

coolaj86 commented Jul 12, 2022

Arrow functions in JS could be used in any circumstances

Usefulness is not a great argument for code style.

* 1 is useful for turning a string into a number (or + '' a number into a string)

! is useful as a replacement for ; between function executions

1.. is useful as a substitute for (1)

There are many anti-semantic things you can do in JavaScript, but they're confusing and signal the wrong thing to the reader of the code.

lambdas signal that you intend to return the evaluation of a mathematical expression in-line. That's what they're for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants