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 ES6 destructuring for neater code #26

Open
jamiecoe opened this issue Oct 31, 2019 · 1 comment
Open

Use ES6 destructuring for neater code #26

jamiecoe opened this issue Oct 31, 2019 · 1 comment

Comments

@jamiecoe
Copy link

In router.js, you are currently pulling properties off an object and saving them into variables like this:

let userEmail = body.email;
let password = body.password;

You can use ES6 destructing to make this neater and easier to read:

let { userEmail, password } = body;

It's a small change, but it reduces unnecessary repetition. Especially if you can use it in a number of places.

@okarem
Copy link
Collaborator

okarem commented Oct 31, 2019

I'm liking your notes more with each issue :D

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

2 participants