I want to know if any element of a string array is duplicated in a given string say:  

`var myArray = ["AB", "CD"];`  

`var givenString = "ABCDAB";`  

 Here, the first element of myArray is repeated in the given string. I want to know(true/false) if this happened in the string. Should have true if any one element occurs more than once. Tried to use `new RegExp(myArray[0]).test(givenString)` but it only tests for a match nothing about the repetition.  

 How can i do this ? I would be happy if i don't have to use flags.