That’s not not really what regexes are for, and your code isn’t testing anything, it’s just accidentally working for some of the cases.
A regex allows you to match a pattern in a string, like
/hello/.test('hello world') will return true, because the pattern
hello is present in that string. It’s for testing if a specific pattern of characters in a specified order are present.
You are saying “does this array contain any single word character”, which doesn’t make sense because an array is not a string. But JS is converting the array to a string to enable it to run the regex, and so you are basically saying “does this string of word characters contain any single word character” which will always be true.
You are supposed to be testing if all the letters in the second word are present in the first; you aren’t doing that at the minute.