javascript count specific characters in string