title: Cucumber JS: I get a "table.rows()" is not a valid function" error when I pass a table and one other variable to step def
body: <p>I am trying to validate values from a cucumber datatable to the front end. The test is working fine when I pass only the datatable to my step def but when I pass a variable along with the datatable; the test breaks and gives an error "<strong>table.rows() is not a valid function</strong>" </p>
  
  <p>Here is my <strong>feature file:</strong></p>
  
  <p>Then the student info for student "1761" should be correct in the student list page</p>
  
  <p>| Name| ID | Dept # |
  | Monnie | 123| 1761|</p>
  
  <p><strong>Step definition:</strong></p>
  
  <pre><code>Then(/^the student info for student "([^"]*)" should be correct in the fund list page$/, function (table, studNumber) {
  let testTable = table.rows();
  return this.pages.prd2Page.getCellInfo(studNumber).then((actualTexts) =&gt; {
  
  return assert.deepEqual(testTable.toString(), actualTexts.toString());
  //return console.log(actualTexts.toString());
  });
  });
  </code></pre>
  
  <p>As you can see, I am passing a datatable and a variable. If I remove the variable and hard code the value everywhere for the variable. This test passes. 
  Could someone share some info as to what might be the problem here? </p>