count charachter nuber in string javascript code example
Example 1: how get count of letters in javascript
//when use length for string this will be return the count of charactor
//in string
$("#about_me_textarea").val().length
Example 2: count characters in typescript
function count (string) {
var count = {};
string.split('').forEach(function(s) {
count[s] ? count[s]++ : count[s] = 1;
});
return count;
}