Вы должны перебрать больший массив и проверить, включен ли каждый элемент в другой массив. Это можно сделать несколькими способами или наоборот, но суть в следующем:
const array_1 = ["area_dust_surface",
"area_dust_furniture",
"area_dust_baseboard",
"area_dust_ceiling"
];
const array_2 = ["area_dust_surface", "area_dust_furniture",
"area_dust_baseboard", "area_dust_ceiling",
"area_vaccum_carpets", "area_vaccum_mop_floors",
"area_dust_windows", "area_dust_pictures",
"area_dust_lamps", "area_dust_mirrors",
"area_empty_trash", "bath_dust_surface",
"bath_dust_windows", "bath_dust_cabinets",
"bath_clean_shower_tubs", "bath_clean_toilets",
"kitchen_dust_chairs", "kitchen_dust_baseboards",
"kitchen_dust_fridge_top", "kitchen_clean_out_fridge",
"kitchen_clean_counters", "kitchen_clean_door_knobs",
"kitchen_clean_light_switch", "kitchen_clean_sinks",
"kitchen_clean_microwave", "kitchen_clean_dishwasher",
"kitchen_clean_kitchen_table",
"kitchen_vaccum_mop_floor", "kitchen_empty_trash",
"bed_dust_surface", "bed_dust_furniture_top",
"bed_dust_surface", "bed_dust_baseboards",
"bed_dust_door_panels", "bed_dust_windows",
"laundry_1", "laundry_2", "laundry_3", "laundry_4",
"laundry_5", "inside_oven_cleaning",
"inside_refrigerator_cleaning",
"inside_washer_machine_cleaning",
"sterilize_washing_machine", "changing_bed_sheets",
"accessible_windows_cleaning"
];
function array_intersect(source, target) {
const output = [];
for (const a of source) {
if (!output.includes(a) && target.some(i => i === a)) {
output.push(a);
}
}
return output;
}
for (const exists of array_intersect(array_2, array_1)) {
console.log('needs to be checked ON:', exists);
}