javascript count number of characters in string