How to determine whether a word from the array in the string?

Something like "22 22 if(dsfds".search(['22', '33'])){.....}

Came to mind only such perversion
eval("/"+["d"].join("|")+"/.test('"+'строкаd'+"')")
July 9th 19 at 10:23
1 answer
July 9th 19 at 10:25
Solution
['22', '33'].some(el => "22 22".indexOf(el) !== -1);
Doesn't work in Safari - Carmel_Muell commented on July 9th 19 at 10:28
['22', '33'].some(function(el) { return "22 22".indexOf(el) !== -1; }); - kristian_McLaughlin commented on July 9th 19 at 10:31
arrow functions - a new standard js. Not yet implemented everywhere =) - kristian_McLaughlin commented on July 9th 19 at 10:34
: Thank you very much - Carmel_Muell commented on July 9th 19 at 10:37

Find more questions by tags JavaScriptHTML