title: Iterate through a HTML table to get Cells using a Typescript in protractor-typescript framework
body: <p>I am writing e2e test using typescript in a protractor-cucumber framework. For my test, I want to compare a HTML table in the UI with the cucumber data table. initially, all I am doing is trying to get each cell text.But I am facing issues iterating through the table. Here is my code, I am new to typescript and javascript and I have mixed up all the syntax. Please excuse if the code doesn't look good. Any pointers are appreciated.</p>
  
  <pre><code>getCellText() {
      console.log('I am here');
      //'brickletrows' is my page object equivalent of 'tbody tr'       
      this.brickletrows.array.forEach(element =&gt; {
        let cells = element.$$('td');
        console.log(cells.getText);
      });
    }
  </code></pre>
  
  <p>I get the error: TypeError: Cannot read property 'forEach' of undefined for the above one</p>
  
  <pre><code> async getCelltexts() {
  //this.Bricklet_table_columns is my page object the equivalent of 'tbody tr td'
  let someArray = [this.Bricklet_table_columns];
  for (let cell of someArray) {
    {
      await console.log(cell.getText());
    }
  }
  </code></pre>
  
  <p>}
  a bunch of gibberish code gets printed out for this one on console.
  My ultimate goal would be to put the cells in a 2D array so that I can use the chai library to assert the cucumber table with the 2D array that i form here. 
  Could someone please point me in the right direction. </p>
  
  <p>I am not able to post the DOM here as it is a sensitive info. But the table is very similar to any HTML table with table id, tbody, th, tr, td tags</p>