Skip to main content

Questions tagged [lodash.js]

A JavaScript utility library delivering consistency, modularity, performance, & extras.

Filter by
Sorted by
Tagged with
1 vote
3 answers
109 views

Hello I have this function that looks for nested value 3 levels deep currently ...
Mateen Kazia's user avatar
0 votes
1 answer
680 views

I need people who have experience with React to review my code. I want to make a debounce using Lodash. import debounce from 'lodash/debounce' ...
kusiaga's user avatar
  • 121
0 votes
1 answer
403 views

I have a nested object and I would like to calculate the number of times the property 'error'. I am able to go n levels deep and find the count. Is there a better solution than mine? ...
arunmmanoharan's user avatar
1 vote
1 answer
3k views

I have two arrays of objects. One has an id property with a list of ids and the second has an object with a unique id property. I want to filter the ids in the second array with the first list and get ...
arunmmanoharan's user avatar
0 votes
1 answer
374 views

I have an array of log objects with log_types and dates, like this: ...
DasBeasto's user avatar
  • 155
4 votes
2 answers
151 views

...
Dupdroid's user avatar
5 votes
2 answers
2k views

I've got such an input object, which I should modify in order to use it with some charts library. ...
Dan Cantir's user avatar
6 votes
1 answer
222 views

My goal here is to make data driven nested forms in React. I've created a function that points to a form configuration JSON, which can contain both components and references to other configuration ...
Johan's user avatar
  • 631
2 votes
0 answers
127 views

Here I created a typed version of lodash flow that offers more specific typing. I'm curious if this exists in any other library, which optimized in tying any way —...
ThomasReggi's user avatar
1 vote
1 answer
531 views

I have an array of nested objects. How do I get an object with null values using only a particular key in the array of objects? ...
arunmmanoharan's user avatar
4 votes
1 answer
111 views

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 ...
ngr's user avatar
  • 115
3 votes
3 answers
104 views

I have a durations as such: [{'duration': 3600}, {'duration': 3600}] And I want the output to be ...
XoXo's user avatar
  • 195
3 votes
2 answers
158 views

I have this array of objects: ...
Katherine Maurus's user avatar
1 vote
2 answers
121 views

Take this: ...
Luca Reghellin's user avatar
3 votes
1 answer
437 views

As a front-end developer, I am given the following result from an API, an array of objects that looks like: ...
149203's user avatar
  • 33
3 votes
0 answers
412 views

The function I've written in Typescript works great, but I'm not convinced that it's the cleanest and most efficient function. The function takes an object, omits properties found in an array, and ...
Nick Blexrud's user avatar
1 vote
2 answers
126 views

Background Last year, while I was still entering the beginning of Immutability and Pure functions and whatnot I created a library for the community called ...
Flame_Phoenix's user avatar
2 votes
1 answer
106 views

Input categories - an array of categories [ { id: 1, title: 'Smartphones' }, { id: 2, title: 'Laptops' } ] ...
Nazar's user avatar
  • 71
11 votes
2 answers
64k views

I ran into a scenario, I'll simplify the data to user/project, where I needed to take values like: ...
edencorbin's user avatar
4 votes
1 answer
4k views

I'm trying to create a filtered list of objects where each object in the list has both a label and value property. First I use .pick to select the key/value pairs ...
Nick Blexrud's user avatar
3 votes
1 answer
2k views

I wanted to build similar to lodash get method. Where you put the object and key name to get value if exist. I have done this but just wanted to have more better approach. Here is what has been done ...
Jitender's user avatar
  • 131
4 votes
1 answer
118 views

I want to transform such object from: foo = { 42: 'foo', 'a.b.c[0].42': 'bar', 'a.b.c[0].43': 'zet', 'a.d.c[0].42': 'baz' } To: ...
Dmytro Rudnitskikh's user avatar
2 votes
0 answers
117 views

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 _....
Gab's user avatar
  • 121
1 vote
1 answer
96 views

So I have this array of objects, which respectively contain other objects: ...
Stafie Anatolie's user avatar
2 votes
1 answer
113 views

I have a helper function I wrote, but it feels like something _.lodash already does or could do if I knew the library better. ...
Troy Weber's user avatar
7 votes
1 answer
105 views

I want to create a "timetable" for some shop. It should look like, "days - hours". I get response from the server in this way: ...
demo's user avatar
  • 175
2 votes
1 answer
4k views

I use the following code to find if there is duplicate value in property path: ...
Rayn D's user avatar
  • 227
0 votes
1 answer
79 views

First here is my settings object below. insight, spike and ...
Leon Gaban's user avatar
2 votes
1 answer
96 views

I'm getting an array and I needed to find a duplicate ID inside: ...
Jenny M's user avatar
  • 271
5 votes
1 answer
3k views

I will be given the following input: ...
Chris's user avatar
  • 153
3 votes
1 answer
2k views

I have an array like this: ...
Yann Bertrand's user avatar
2 votes
1 answer
517 views

I have the following structure returned from MongoDB: ...
jeffci's user avatar
  • 248
5 votes
1 answer
183 views

I have recently finished my first iteration of a template method implementation for a JavaScript canvas animation of the snake game. However, I would love for the community to critique this code and ...
Nifty's user avatar
  • 53
1 vote
1 answer
8k views

I have the following code, that groups similar todos into an array of arrays, using lodash (https://lodash.com). Here is a plnkr http://plnkr.co/edit/t4J5bKGjMlQxW2z9Zh7x?p=preview (open your console ...
23tux's user avatar
  • 227
3 votes
4 answers
13k views

I have data like: ...
serkan's user avatar
  • 133
1 vote
3 answers
188 views

I have an array of this fashion: var arr = ["akira",9248,"padilla",100]; I'm using filter to take the names and the points: <...
diegoaguilar's user avatar
7 votes
1 answer
47k views

I have two different arrays: ...
JulieMarie's user avatar
7 votes
1 answer
42k views

Here's a function that sorts an array of objects with a dateProp by the date. First it uses moment to convert the Date object to ...
ThomasReggi's user avatar
2 votes
0 answers
79 views

This is horrendous. I'm using lodash's templating engine for this table. Here's the template for an individual record's row. I've got 5 different table and ...
Robin's user avatar
  • 201
5 votes
6 answers
64k views

Given a table represented as a javascript array of objects, I would like create a list of unique values for a specific property. ...
David says Reinstate Monica's user avatar
3 votes
1 answer
558 views

The code below doesn't seem right to me. The scenario is: User enters in a "quantity" into a form field. If the user enters in 5, the loop below should iterate 5 times. There should now be 5 new ...
jeffci's user avatar
  • 248
2 votes
1 answer
239 views

I don't like how transforming the data requires a bunch of nested functions. It's not very readable. Is there a more readable way to do the same transformations in Lodash? ...
M.K. Safi's user avatar
  • 129
0 votes
1 answer
118 views

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 ...
shabunc's user avatar
  • 243
3 votes
1 answer
12k views

I'm working on an API testing algorithm within the Postman REST client and I wanted a simple and elegant deep diff function to test my JSON responses. I only have access to Lodash within Postman's ...
toshiomagic's user avatar
11 votes
1 answer
240 views

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. <...
pistacchio's user avatar
7 votes
2 answers
5k views

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 ...
Ahmed Fasih's user avatar
1 vote
1 answer
2k views

I am mainly trying to avoid the nested forEach statements and am trying to move towards a lazy evaluation type solution. jsFiddle ...
Jeff Voss's user avatar
  • 233
3 votes
4 answers
12k views

I have an array of objects. Whatever may be the size of this array, I need to ensure the size of the array as n using a default object. ...
Jazmin's user avatar
  • 133
4 votes
2 answers
70 views

I have a data set returned from an SQL database contained below, as you can see all data remains the same apart from one property, "name_alt". ...
Joseph's user avatar
  • 165