JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://getfirebug.com/firebug-lite-debug.js"></script>

JavaScript

function inArray(xs, ys) {
  return xs.filter(x => ys.some(y => y.includes(x)));
}

a2 = ["xyzz", "alive", "harp", "sharp", "armstrong"]

a1 = ["xyz", "live", "strong"]

console.log(inArray(a1, a2));