We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider following code:
(function iife() { function foo(arr) { return arr.map(e=>e.someProperty).filter(Boolean) } function bar() { return arr.map(e=>e.someProperty).filter(e=>e===3) } return {foo, bar}; }())
This code can have e=>e.someProperty lifted to outer scope to avoid repeating code. The same optimization can be applied to constant expressions.
e=>e.someProperty
Pros:
Cons:
(e=>e) !== (e=>e)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Consider following code:
This code can have
e=>e.someProperty
lifted to outer scope to avoid repeating code. The same optimization can be applied to constant expressions.Pros:
Cons:
(e=>e) !== (e=>e)
- functions are objects and they are compared by identity, not by valueThe text was updated successfully, but these errors were encountered: