typescript find non matching objects in two arrays

The solution for “typescript find non matching objects in two arrays” can be found here. The following code will assist you in solving the problem.

const first = [‘cat’, ‘dog’, ‘mouse’];
const second = [‘zebra’, ‘tiger’, ‘dog’, ‘mouse’];
const removeCommon = (first, second) => {
   const spreaded = […first, …second];
   return spreaded.filter(el => {
      return !(first.includes(el) && second.includes(el));
   })
};
console.log(removeCommon(first, second));

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in