-
-
Save windwarrior/fd5cf8f0572bcacd2c65aaaae9169265 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Style 1 | |
content_list = considered_devs | |
.filter(x => x.content) | |
.map(x => { | |
// this is a more complex lambda | |
}) | |
.map(moreComplexFunction) | |
.map(x => x.content) | |
.reduce((accum, x) => accum.concat(x), []) | |
// Style 2 | |
let content_list = considered_devs.filter(x => x.content) | |
.map(x => { | |
// this is a more complex lambda | |
}) | |
.map(moreComplexFunction) | |
.map(x => x.content) | |
.reduce((accum, x) => accum.concat(x), []) | |
// Style 3 | |
let content_list = considered_devs.filter( | |
x => x.content | |
).map(x => { | |
// this is a more complex lambda | |
}).map( | |
moreComplexFunction | |
).map( | |
x => x.content | |
).reduce( | |
(accum, x) => accum.concat(x), | |
[] | |
) | |
// Style 4 | |
let content_list = | |
considered_devs.filter(x => x.content) | |
.map(x => { | |
// this is a more complex lambda | |
}) | |
.map(moreComplexFunction) | |
.map(x => x.content) | |
.reduce((accum, x) => accum.concat(x), []) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment