結果 : count instances of character in string javascript