Skip to content
New issue

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

Use arrow functions when self = this is declared in parent scope #79

Open
eventualbuddha opened this issue Jan 9, 2016 · 0 comments
Open

Comments

@eventualbuddha
Copy link
Contributor

For example:

var self = this;
return function() {
  return self;
}

can become:

return () => this;

The usual caveats apply:

  • referencing this inside the function disqualifies it (unless it's also a .bind(this) function?)
  • referencing arguments inside the function disqualifies it (unless we can rewrite using rest params)
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

No branches or pull requests

1 participant