I try to match/get all repetitions in a string. This is what I\'ve done so far:
var str = \'abcabc123123\'; var REPEATED_CHARS_REGEX = /(.).*\\1/gi; console
This solution may be used if you don't want to use regex:
function test() { var stringToTest = 'find the first duplicate character in the string'; var a = stringToTest.split(''); for (var i=0; i