Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #character #javascript
ADD COMMENT
Topic
Name
4+9 =