Horje
compare and filter two array of object Code Example
compare and filter two array of object
array1 = [{path: "hello"}, {path: "world"}];
array2 = [{path: "hello"}, {path: "hahah", text: "dsdsds"}];

//comparing array1 and array2 and returning unmatced from array1

Object.keys(array1)
  .filter((val, index) => array1[index].path !== array2[index].path)
  .map((val, index) => array1[index]);

// output
//[{"path": "world"}]




Javascript

Related
javascript iterate through an object (key, value) Code Example javascript iterate through an object (key, value) Code Example
js first letter capital Code Example js first letter capital Code Example
sum of digits in a whole number javascript Code Example sum of digits in a whole number javascript Code Example
how to take create array using jquery Code Example how to take create array using jquery Code Example
javascript assign value to input using name Code Example javascript assign value to input using name Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7