how to get each char fro, string js code example
Example 1: js for each character in string
for (var i = 0; i < str.length; i++) {
alert(str.charAt(i));
}
Example 2: count value a to b character javascript
function count (string) {
var count = {};
string.split('').forEach(function(s) {
count[s] ? count[s]++ : count[s] = 1;
});
return count;
}