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

change forEach to reduce in home.js route #47

Merged
merged 2 commits into from
Apr 6, 2017
Merged

change forEach to reduce in home.js route #47

merged 2 commits into from
Apr 6, 2017

Conversation

philawsophizing
Copy link
Contributor

sorry took me a minute had to re-learn it quickly! I guess reduce is better/more explicit..? but seems like more code/effort in a way

@philawsophizing philawsophizing requested a review from jwld April 6, 2017 09:27
total += row.transaction_value;
});
// Sum the transactions in the kitty
let total = response.rows.reduce(function(acc, row) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is acc?
and maybe use es6 for consistency?

@philawsophizing
Copy link
Contributor Author

@Karyum check out changes

Copy link
Member

@Karyum Karyum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

@Karyum Karyum merged commit b507f9b into master Apr 6, 2017
@Karyum Karyum deleted the reduceFunction branch April 6, 2017 09:45
@jwld
Copy link
Member

jwld commented Apr 6, 2017

#32

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

Successfully merging this pull request may close these issues.

3 participants