This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MatchArrOnStrings = ({ | |
arr: ['red', 'blue', 'green'], | |
string: 'We have a red and blue and green Thingies', | |
}) => { | |
const a = arr; | |
const b = string; | |
const reg = new RegExp(a.join('|'), 'g'); | |
const c = b.match(reg); | |
return c.length == a.length; |