Why do I I get undefined in this calculation in JavaScript?
<p>I try to loop through the whole array and find out how 'true' they are. Now when I run the function I get some <strong>undefined-result</strong>. :( Why?</p>

<pre><code>myArray = [
    {text: 'hola', done: false},
    {text: 'hola', done: true},
    {text: 'hola', done: true},
    {text: 'hola', done: false},
    {text: 'hola', done: true}
  ];

  var howMany = function(myArray){

     var result;
      for (var item in myArray){
          if(myArray.done === true)
            result++;
      }
      return result;
  };


var items =howMany(myArray);
    console.log(items) // I want to see if it's correct
</code></pre>
