javascript count unique characters in string