count number of characters in string javascript