count number of repeated characters in string javascript