compare two array of object and return unmatched elements
/comparing array 'b' to array 'a'
//returning unmatched elements from array 'b'
var a=[{icon:"fas fa-biohazard",path:"covid-logs",title:"Covid Logs"},{icon:"fas fa-users",path:"attendance",title:"Attendance Calendar"},{icon:"fas fa-newspaper",path:"news",title:"News"}];
var b=[{path:"all-maintenance-tickets-tracker",title:"Facility Maintenance All",icon:"fas fa-tools"},{path:"billing-provider-pay-billed",title:"Billing (Billed Amount)",icon:"fas fa-money-bill"},{path:"billing-provider-pay-collected",title:"Billing (Collected Amount)",icon:"fas fa-money-bill"},{path:"manager-invoice-approval",title:"Invoice Approval",icon:"fas fa-file-invoice-dollar"},{path:"provider-invoice-submission",title:"Invoice Submission",icon:"fas fa-file-invoice-dollar"},{path:"provider-invoice",title:"Invoice Status",icon:"fas fa-file-invoice-dollar"},{path:"provider-dashboard",title:"Invoice Dashboard",icon:"fas fa-file-invoice-dollar"},{path:"provider-pay-billed",title:"Pay Provider (Billed Amount)",icon:"fas fa-money-check"},{path:"provider-pay-collected",title:"Pay Provider (Collected Amount)",icon:"fas fa-money-check"},{path:"provider-invoices",title:"Provider Invoices",icon:"fas fa-user"},{path:"provider-payscale",title:"Provider Setup",icon:"fas fa-user"},{path:"partner-report",title:"Partner Report",icon:"far fa-handshake"},{path:"employee-list",title:"Hiring",icon:"fas fa-file-signature"},{path:"incident-report-tracker",title:"Incident Report",icon:"fas fa-car-crash"},{path:"attendance-all",title:"Attendance Calendar All",icon:"fas fa-clipboard-user"},{path:"attendance",title:"Attendance Calendar",icon:"fas fa-clipboard-user"},{path:"working-hours",title:"Working Hours",icon:"fas fa-hourglass-half"},{path:"blogs",title:"Blogs",icon:"fab fa-blogger"},{path:"equipment-list",title:"IT Equipments",icon:"far fa-computer-classic"},{path:"all-tickets-tracker",title:"IT Tickets All",icon:"far fa-sitemap"},{path:"follow-up-calls",title:"Follow Up Calls (FD)",icon:"fas fa-phone-volume"},{path:"follow-up",title:"Follow Up Tracker",icon:"fad fa-analytics"},{path:"patients",title:"Patient Tracker",icon:"fal fa-analytics"},{path:"hrt-questionnaire-list",title:"HRT Questionnaire",icon:"fas fa-question-circle"},{path:"ams-questionnaire-list",title:"AMS Questionnaire",icon:"fas fa-question-square"},{path:"puf-tracker",title:"PUF Tracker",icon:"fas fa-analytics"},{path:"contacts",title:"Contacts",icon:"fas fa-address-book"},{path:"meeting-groups",title:"Meeting Groups",icon:"fas fa-chalkboard-teacher"},{path:"covid-logs",title:"Covid Logs",icon:"fas fa-biohazard"},{path:"maintenance-tickets-tracker",title:"Facility Maintenance",icon:"fas fa-tools"},{path:"portal-health",title:"Daily Processes Status",icon:"fas fa-download"},{path:"tickets-tracker",title:"IT Tickets",icon:"far fa-sitemap"},{path:"admin/users",title:"Users",icon:"fas fa-users"},{icon:"fas fa-newspaper",path:"news",title:"News"}];
var result = b.filter(function(obj) {
return !a.some(function(obj2) {
return obj.path == obj2.path;
});
});
//typescript
var result = b.filter((obj) => {
return !a.some((obj2) => {
return obj.path == obj2.path;
});
});