Top "Lodash" questions

A modern JavaScript utility library delivering modularity, performance, and extras.

How to remove undefined values from array but keep 0 and null

In javascript, I want to remove undefined values, but keep the values 0 and null from an array. [ 1, 2, 3, undefined, 0, null ] How …

lodash
Lodash debounce with React Input

I'm trying to add debouncing with lodash to a search function, called from an input onChange event. The code below …

reactjs lodash relay debouncing
Split JavaScript array in chunks using Lodash

I need to split a JavaScript array into n sized chunks. E.g.: Given this array ["a1", "a2", "a3", "a4", "…

javascript split functional-programming underscore.js lodash
How can I use lodash/underscore to sort by multiple nested fields?

I want to do something like this: var data = [ { sortData: {a: 'a', b: 2} }, { sortData: {a: 'a', b: 1} }, { sortData: {a: 'b', …

javascript underscore.js lodash
lodash _.find all matches

I have simple function to return me object which meets my criteria. Code looks like: var res = _.find($state.get(), …

javascript lodash
Can _lodash test an array to check if an array element has a field with a certain value?

I have a variable selectedSubTopicId and I have an array of subTopic objects: objectiveDetail.subTopics[]. Each subTopic object has a …

javascript lodash
How do you chain functions using lodash?

I have an object that looks like var foundUser = { charData: [] } which then I load an object from a database using …

javascript lodash
How to convert object containing Objects into array of objects

This is my Object var data = { a:{"0": "1"}, b:{"1": "2"}, c:{"2": "3"}, d:{"3": "4"} }; This is the output that I expect data = [ {"0": "1"}, {"1": "2"}, {"2": "3"}, {"3": "4"} ]

javascript lodash
How to use throttle or debounce with React Hook?

I'm trying to use the throttle method from lodash in a functional component, e.g.: const App = () => { const [value, …

reactjs lodash react-hooks throttling
How to repeat an element n times using JSX

I am using React/JSX in my app in order to accomplish what I want, also, Lodash. I need to …

javascript reactjs lodash