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

Array map #2

Merged
merged 7 commits into from Nov 28, 2017

Conversation

Projects
None yet
1 participant
@jedd-ahyoung
Owner

jedd-ahyoung commented Nov 27, 2017

No description provided.

@jedd-ahyoung

This comment has been minimized.

Show comment
Hide comment
@jedd-ahyoung

jedd-ahyoung Nov 27, 2017

Owner

Ashley's feedback:

Not having anything about the for..of loop is weird
I just say that since it pretty well maps exactly to Array.forEach for most devs
Also, it'd be good to mention using break inside a for loop.
You could then talk about how using array.filter().forEach() or somethign might be akin to using break in some situations
I see you mention that in your use cases
But there isn't much explanation of it
" You need to iterate over a sparse array and only want to run your functions for populated elements." That's pretty important there
And you don't mention it at all in the section on forEach
" You need to dynamically choose an operation to apply over your collection at runtime." ehhhhh
Can easily do that with a for loop as well
" You want to only map a subset of an array to a transformation. Use a for loop, or filter your collection before you map it."
Maybe an example of using filter and then forEach or map would be nice

Owner

jedd-ahyoung commented Nov 27, 2017

Ashley's feedback:

Not having anything about the for..of loop is weird
I just say that since it pretty well maps exactly to Array.forEach for most devs
Also, it'd be good to mention using break inside a for loop.
You could then talk about how using array.filter().forEach() or somethign might be akin to using break in some situations
I see you mention that in your use cases
But there isn't much explanation of it
" You need to iterate over a sparse array and only want to run your functions for populated elements." That's pretty important there
And you don't mention it at all in the section on forEach
" You need to dynamically choose an operation to apply over your collection at runtime." ehhhhh
Can easily do that with a for loop as well
" You want to only map a subset of an array to a transformation. Use a for loop, or filter your collection before you map it."
Maybe an example of using filter and then forEach or map would be nice

@jedd-ahyoung

This comment has been minimized.

Show comment
Hide comment
@jedd-ahyoung

jedd-ahyoung Nov 28, 2017

Owner

Compare to lodash and underscore implementations.

Owner

jedd-ahyoung commented Nov 28, 2017

Compare to lodash and underscore implementations.

@jedd-ahyoung jedd-ahyoung merged commit 6b765f9 into gh-pages Nov 28, 2017

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