title: How to check if text is found in column in Protractor
body: <p>I'm trying to assert that a name is displayed in a column of a table. I've written an <code>inResults</code> function that will iterate through a column's text to see if a name exists. Here's what I'm trying:</p>
  
  <p>Page object:</p>
  
  <pre><code>this.names = element.all(by.repeater('row in rows').column('{{row}}'));
  
  this.inResults = function(nameString) {
      var foundit = '';
      this.names.each(function(name) {
          name.getText().then(function(it) {
              console.log(it); // each name IS printed...
              if(it == nameString) {
                  console.log('it\'s TRUE!!!!'); // this gets printed...
  
                  foundit = true;
              }
          });
      });
      return foundit; // returns '' but should be true?
  };
  </code></pre>
  
  <p>Spec expect:</p>
  
  <pre><code>expect(friendPage.inResults('Jo')).toBeTruthy();
  </code></pre>
  
  <p>Both console statements print as expected... but my expect fails as <code>foundit</code>'s value is still <code>''</code>. I've tried this a number of ways and none are working. What am I missing? </p>