Top "Lodash" questions

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

How to perform union or intersection on an array of arrays with Underscore.js

I have an array of arrays: var selected = [[1, 4, 5, 6], [1, 2, 3, 5, 7], [1, 4, 5, 6], [1, 7]]; Underscore.js has convenient union and intersection methods but they work on …

javascript underscore.js lodash
Lodash ReferenceError: _ is not defined in Vue even though it works everywhere else

In my component shoppingCart.vue file I'm calling a simple method: saveCart : _.debounce(() => { console.log('hi'); }, 2000), But I get …

vue.js vuejs2 lodash vue-router debounce
Lodash rounding precision

I'm trying to display a number as a percent by using _.round and then by multiplying the number by 100. For …

javascript rounding percentage lodash floating-point-precision
Where is _.pluck() in lodash version 4?

What happened to pluck() in lodash version 4? What is a suitable replacement? This syntax _.pluck(users, 'firstName'); is simple to …

javascript lodash
Javascript- Lodash shuffle vs. Math.Random()

I'm in the process of coding a simple BlackJack game in Javascript. So far, I have an array like this: …

javascript random lodash shuffle playing-cards
Any way to use immutable.js with lodash?

I'm using immutable.js with my flux application. It is very useful and gives performance boost. But what actually makes …

javascript reactjs immutability lodash immutable.js
How can I debounce using async/await?

I have an input box. After the user has stopped typing, I want to perform an HTTP request and await …

javascript async-await lodash debounce
Converting lodash _.uniqBy() to native javascript

Here in this snippet i am stuck as in _.uniqBy(array,iteratee),this iteratee can be a function or a …

javascript arrays lodash distinct-values
Deep Flatten JavaScript Object Recursively

Data: var data = [ { "id": 1, "level": "1", "text": "Sammy", "type": "Item", "items": [ { "id": 11, "level": "2", "text": "Table", "type": "Item", "items": [ { "id": 111, "level": "3", "text": "…

javascript recursion javascript-objects lodash
using debounce for search input in react

I have a search input, to make API calls on the fly. I'd like to implement debounce to reduce the …

javascript reactjs lodash debounce