function inArray(needle, haystack, matchAll = false) {
if (matchAll) {
return needle.every(i => haystack.includes(i));
} else {
return needle.some(i => haystack.includes(i));
}
}
let result = inArray(needle, haystack, true);