javascript count all characters in string