JAVASCRIPT

Are We Ready to Replace Lodash?

A look at JavaScript and RxJS functions that replace widely used Lodash functions

Yandre
The Startup
Published in
2 min readJul 9, 2020

--

Photo by Tracy Adams on Unsplash

Lodash is a series of JavaScript utility functions used to make every front-end developers lives much easier. It is an insanely popular library that still gets 26 million downloads per week. There is a lot of community support for the library and there’s 115,000 libraries that are dependent on it as well.

But are we still in need of it? With the advancement of ECMAScript and the introduction of the RxJS library, there are multiple new functions and syntaxes that replace many Lodash functions.

Here are some Lodash functions and how they can be called instead using JavaScript:

_.debounce

Description: Function that delays evoking specified function until after a certain time frame.

Lodash version:

window.addEventListener('click', _.debounce(400));

JavaScript version (using RxJS):

fromEvent(window, 'click').pipe(debounce(400));

_.pick

Description: Creates an object composed of items from object .

--

--