Filter array of objects by array of ids
You can simply use array.filter with indexOf to check the matching element in the next array. var arr = serviceList.filter(item => activeIds.indexOf(item.id) === -1); DEMO let activeIds = [202, 204] let serviceList = [{ “id”:201, “title”:”a” }, { “id”:202, “title”:”a” }, { “id”:203, “title”:”c” }, { “id”:204, “title”:”d” }, { “id”:205, “title”:”e” }]; let arr … Read more