I have two object arrays, say arr1,arr2. I want to create a new array arr3. This new array contains the values from arr1 only if that values id exist in arr2 object values.
How can I achieve this in nodejs frontend ?
I have two object arrays, say arr1,arr2. I want to create a new array arr3. This new array contains the values from arr1 only if that values id exist in arr2 object values.
How can I achieve this in nodejs frontend ?
ES6 intersection:
let arr3 = arr1.filter(x => arr2.includes(x));
You might want to check the data transformations actions.