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

Request: Shortcut for declaring an ES6 fat arrow function that doesn't take parameters. #1265

Closed
ozzie1998 opened this Issue Jul 14, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@ozzie1998

ozzie1998 commented Jul 14, 2018

Declaring an ES6 Fat arrow function is like so:

let example = () => {/*Blah*/}

It would be handy to be able to declare an ES6 Fat Arrow Function that doesn't take any parameters like so:

let example => {/*blah*/}

The main problem with this would be that this isn't immediately obvious as a function.

Advantages of a shorter Fat Arrow function declaration for a function that doesn't take any arguments:

  1. Less to type
  2. Makes writing callbacks easier
@devsnek

This comment has been minimized.

Show comment
Hide comment
@devsnek

devsnek Jul 14, 2018

Contributor

seems more confusing than useful. adding too much syntax has a strain on people writing the language.

Contributor

devsnek commented Jul 14, 2018

seems more confusing than useful. adding too much syntax has a strain on people writing the language.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Jul 14, 2018

Member

Please see Contributing to ECMAScript for the most up-to-date information on contributing proposals to this standard.

Member

ljharb commented Jul 14, 2018

Please see Contributing to ECMAScript for the most up-to-date information on contributing proposals to this standard.

@ljharb ljharb closed this Jul 14, 2018

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