Re:JavaScript- Lodash vs Js function vs. for vs. for each
by jrs95 on Friday May 11, 2018 @07:53PM
(#17051569)
+1 for Ramda -- I've been using it for around 2 years now and once you get comfortable with how to compose it's various functions (and some of your own) it's super powerful. Might not be the best choice if your team is allergic to FP though, some people have a difficult time wrapping their head around it (or just getting used to the syntax). I've gone out of my way to document everything thoroughly knowing people who are mostly unfamiliar with FP will be looking at it though, and that's kept everyone happy.
Re:JavaScript- Lodash vs Js function vs. for vs. for each
by Rick-Butler on Friday May 11, 2018 @10:38PM
(#17052205)
Lodash is fairly ubiquitous, you can sneak in some lodash fp into projects. Dalton even has it aliased for ramda. The artity for certain functions might be different I didn’t check.
https://github.com/lodash/lodash/commit/6b2645b3106b0ed9ebec...
Although Ramda has forEach, I augment it with a version of each(func, data) where data can be an array or map, and func(val, key) where key is the key of the map item, or the index of the item in the array.
I feel this abuse of notation makes for more readable / smaller / uniform code [ having no explicit for loops ]. Also takes less conceptual space.