javascript get count of substring in string