Count the number of true members in an array of boolean values : <p>New to javascript and I'm having trouble counting the number of trues in an array of boolean values.  I'm trying to use the reduce() function.  Can someone tell me what I'm doing wrong?</p>

<pre><code>   //trying to count the number of true in an array
    myCount = [false,false,true,false,true].reduce(function(a,b){
      return b?a++:a;
    },0);
    alert("myCount ="+ myCount);  // this is always 0
</code></pre>
