title: Protractor map function returning undefined
body: <p>Given an app with multiple widgets on it, each with their own title and whatnot, I would like to map each widget's elements, to make them easy to handle in tests. </p>
  
  <p>For example, a page: </p>
  
  <pre><code>this.widgets = element.all(by.css('ul.widget-grid')).map(function(widget, index) {
      return {
          index: index,
          title: widget.element(by.css('div.title')).getText()
      };
  });
  </code></pre>
  
  <p>And then in my spec:</p>
  
  <pre><code>expect(page.widgets[0].index).toBe(0);
  expect(page.widgets[0].title).toBe('The Title');
  </code></pre>
  
  <p>Unfortunately, my expects are returning <code>undefined</code>. </p>
  
  <p>What am I doing wrong? I'm using Protractor 2.0.</p>