jeudi 2 juillet 2020

use lodash to find substring from array and to push them to another and then to compare result with the 3rd table

I have array:

all [a,b,ac,d, A]

and I want to find in this all elements which include substring "a" ("A") using filter from lodash and push them to another - to the filterTab

   const item = "a"

I try sth like this:

import { some, method, differenceWith, isEquel } from 'lodash';
const filterTab = [];

filterTab.push (some(all, method('match',/item/i)));

But it does not work.

The next step if it works- it will be something like this:

var dif = differenceWith(filterTab, array3, _.isEqual);

And I have no idea why it does not work...

Aucun commentaire:

Enregistrer un commentaire