All Questions
Tagged with lodash.js functional-programming
8 questions
4
votes
1
answer
85
views
Finding optimal mapping patterns that transform relational data into a linear format
I'm trying to upgrade my javascript to be more functional. I have used function composition and curry successful on less complicated code but i'm now running into a point where i'm not sure on how to ...
3
votes
3
answers
76
views
Counting duration values
I have a durations as such:
[{'duration': 3600}, {'duration': 3600}]
And I want the output to be ...
3
votes
1
answer
419
views
Transforming data from an API using Typescript and Lodash
As a front-end developer, I am given the following result from an API, an array of objects that looks like:
...
2
votes
0
answers
108
views
Set manipulation (javascript arrays) using lodash
I'd like a more elegant and readable (if possible using functional programming style) for collection filtering (groupToAdd and groupToDelete collection handling)
Just getting rid of multiple _....
2
votes
1
answer
75
views
Comparing corresponding elements of two equal-length arrays
I have a helper function I wrote, but it feels like something _.lodash already does or could do if I knew the library better.
...
0
votes
1
answer
86
views
Filtering/mapping strategies
This is real JavaScript/Lodash code used in a project I'm currently working on, but actually this particular question bothers me quite often regardless of the language. Say, I need to generate some ...
11
votes
1
answer
228
views
Hunt the wumpus: Functional JavaScript (Node) with Lodash
I'd like a code review of the following simple implementation of the classic game Hunt the Wumpus
I'm trying to use JavaScript in the most "functional" way. To help me, I'm using lodash and ES6.
<...
7
votes
2
answers
5k
views
"Invert" a JavaScript object hash whose values are arrays to produce a new object hash with keys as the elements of those original value vectors
Background
lodash and underscore have an invert function that takes an object hash and converts it to a new one, which has keys as the input object's values and ...