title: Custom Javascript Validation without using map,filter
body: <p>I have function for validation for check below scenarios, but function used map and filter methods. so <code>its not working in IE8</code>.How to rewrite this function without using map and filter.</p>
  
  <pre><code>var case1 = "stack(2),flow(2),over(4),temp(7)"; - true
  var case2 = "stack(2),flow(3),over(4),temp(k)"; - false
  var case3 = "stack(2),flow(2),over(4),temp(0"; - false
  var case4 = "stack(2),flow(2),over(,temp)"; - false
  var case5 = "stack(2),flow(2),over(4)temp(8)"; - false
  var case6 = "stack(1),flow(7),over,temp"; - true
  var case7 = "stack(1),flow(7),OVER,Temp"; - true
  var case8 = "stack(1),flow(7),over_r,temp_t"; - true
  </code></pre>
  
  <p>Javascript function :</p>
  
  <pre><code>function validateChunk(s)
  {
      return !!s.match(/^[a-z]+(?:\(\d+\))?$/);
  }
  
  function filterValid(v)
  {
      return !v;
  }
  
  function testCases(str)
  {
      var chunks = str.split(",");
      var validated = chunks.map(validateChunk);
      return (0 === validated.filter(filterValid).length);
  
  }
  </code></pre>
  
  <p><a href="http://jsfiddle.net/c8t26/7/" rel="nofollow">jsfiddle</a></p>