Question: Assuming:
str value = 'This is some text';

I want to count how many 't' occurrences, how to do that?

Answer: 
```
var sValue = 'This is some text';
var tCount = sValue.split("t").length - 1;
alert("t appears " + tCount + " times");

```

If you want to count occurrences of all letters, you better use one loop as shown in the other answers.
May be can help you here

```
.replace().length

```

with regards

**Wazzy**