title: Finding the most frequent character in a string javascript
body: <p>Assuming I have the following string "355385". I need a simple JavaScript that can tell me that the most mentioned character is 5. Thank you in advance.</p>
  
  <p>I tried with this one but no results.</p>
  
  <pre><code>var exp = '355385' ;
  
  var exps =exp.split("");
  
  var expCounts = { };
  
  for (var i=0;i&lt;exp.length;i++)
  
  {expCounts["_" + exps[i]] = (expCounts["_" + exps[i]] || 0) + 1 ;
  
  if (expCounts==3) exps=exps[i]; }; exps;
  </code></pre>