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

Support console.logs in JavaScript implicit returns #3

Open
agarrharr opened this issue Jan 10, 2017 · 2 comments
Open

Support console.logs in JavaScript implicit returns #3

agarrharr opened this issue Jan 10, 2017 · 2 comments

Comments

@agarrharr
Copy link
Owner

agarrharr commented Jan 10, 2017

For example, if you want to console.log a in this function, you have to use a comma instead of a semicolon.

const sum = (a, b) => (
  console.log(a),
  a + b
);
@agarrharr
Copy link
Owner Author

Here is another example. If you don't have parenthesis, then you need to use ||.

const sum = (a, b) => a + b

If my cursor is on the a and I want it console.log right before my cursor, it should produce this:

const sum = (a, b) => console.log(a) || a + b

@agarrharr
Copy link
Owner Author

Or, if it was on 2 lines, then this:

const sum = (a, b) =>
  a + b

should produce this:

const sum = (a, b) =>
  console.log(a) ||
  a + b

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