The power of lodash

by Aymen on 01/5/2016

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

 – Source :

In production life, it’s a waste of time doing what is already done. In javascript we have a pretty cool  library called “Lodash” it’s tiny and smart, let’s see how :

Example :

Really famous routine, removing an element from simple Javascript Array

Native javascript :

for (var i = 0; i < tagContainer.length; i++) {
if (tagContainer[i] == removedTag) {
tagContainer.splice(i, 1);

 With lodash : 

_.pull(tagContainer ,removedTag);

How about assigning/getting a value to an element using a string as a name/key?

var user = {};
_.set(user,’’, ‘Aymen’ );
// get name
// Aymen

Download :

There are 2 comments in this article:

  1. 01/5/2016majdi says:

    yoeman will do that for you 🙂

  2. 01/6/2016aymen says:

    @majdi yoeman is different, it is a scaffolding tool (app or script generator), lodash is a tiny javascript library.

Write a comment: